When I went over to see a rare coin collection, I asked the care taker of the coins about them.
"What can you tell me about your coins?"
"In each box, the number of coins is a perfect square, and each box has a different number of coins."
"How are the coins in your 9 boxes organized?"
"I put them in chronological order by groups. The ancient coins are in boxes A, B, C; my old coins in boxes D, E, F; and my recent coins sit in boxes G, H, I."
"How else are they organized?"
"Well, within each time period (ancient, old, recent), the numbers form an arithmetic sequence, and the common difference is the same for all three time periods."
"How many coins do you have in each box?"
"I'm not sure, but I do know that a newer box would always have more coins that an older box from that time period. For example, feel box A. I have very few coins in that box, less than a dozen."
How many coins are in each box?
DEFDBL A-Z
OPEN "coincoll.txt" FOR OUTPUT AS #2
t = 2
DO
t = t + 1
FOR a = 1 TO t / 2 - .5
b = t - a
s = 2 * b * b - a * a
c = INT(SQR(s) + .5)
IF c * c = s THEN
PRINT #2, a * a, b * b, s, s - b * b
ct = ct + 1
IF ct > 4000 THEN EXIT DO
END IF
NEXT
LOOP
CLOSE
produces a list from which the following are found:
----------------------- 15 LINE(S) NOT DISPLAYED --
4 3364 6724 3360
----------------------- 29 LINE(S) NOT DISPLAYED --
2116 5476 8836 3360
----------------------- 44 LINE(S) NOT DISPLAYED --
9409 12769 16129 3360
---------------------- 3910 LINE(S) NOT DISPLAYED -
The 3360 is the common difference, and the only one that appears three times and includes one where the lowest number is less than 12. There could be some really huge numbers that have as many or more repetitions (which still includes the possibility of the first number being low), so uniqueness is not guaranteed (except that 16,129 is already a large number of coins to have in a box and solutions beyond the scope of the search would include numbers in the tens of millions).
|
Posted by Charlie
on 2004-05-04 11:19:51 |