Determine the minimum value of a positive integer N such that the 2nd, 3rd, 4th and 5th digits in order immediately following the decimal point (reading left to right) in the base ten expansion of √N is 2013.
*** For an extra challenge, solve this puzzle without using a computer program.
(In reply to
No Subject by brianjn)
DEFDBL A-Z
CLS
found = 0
FOR i = 1 TO 999
FOR j = 0 TO 9
low = i + j / 10 + .02013#: high = i + j / 10 + .02014#
low2 = low * low: high2 = high * high
IF INT(high2) <> INT(low2) THEN
PRINT INT(high2), SQR(INT(high2))
found = found + 1
END IF
NEXT j
IF found > 20 THEN EXIT FOR
NEXT
PRINT
finds
4532 67.32013071882734
13976 118.2201336490532
22207 149.0201328680122
23019 151.7201370945861
31620 177.8201338431619
42568 206.3201395889407
57322 239.4201328209472
69127 262.9201399664925
88816 298.0201335480541
96547 310.7201313079022
100375 316.8201382488178
116636 341.5201311782367
121536 348.6201371120148
137137 370.3201317778983
147011 383.4201350998667
149862 387.1201363917925
165584 406.9201395851525
169102 411.2201356937668
186555 431.9201315058144
197776 444.7201367152155
199827 447.0201337747552
differing from brian's list by including 22207 and 88816, and does not include 56664 (my list has 21, yours 20). You will see from the former listing that sqrt(56664) is in fact 238.0420130985285, where the "2013" doesn't start until the 3rd place after the decimal point. The two included in my list but not yours both have a zero immediately after the decimal point and are the only two such.
I think it was better to start with the desired square root and square it rather than parse the square root of every integer.
Edited on January 10, 2013, 11:57 am
|
Posted by Charlie
on 2013-01-10 11:49:58 |