In the line of
1233 = 12² + 33²
990100 = 990² + 100²
can you find an eight digit number with the same property? Even longer numbers?
(In reply to
more values by Charles Lutes)
If 2n is the number of digits in the total then
(10^n)*a + b = a^2 + b^2
and
a^2 - (10^n)*a + b^2 - b = 0
and
a = (10^n +/- sqrt(10^(2*n) - 4*(b^2 - b)) / 2
UBASIC allows for extra precision variables, so:
5 N=10^1
6 repeat
10 repeat
30 D=(N^2-4*(B*B-B))
40 Sd=int(sqrt(D)+0.5)
50 if Sd*Sd=D then
60 :print B,(N-Sd)//2,(N+Sd)//2
70 B+=1
80 until 4*(B*B-B)>=N^2
90 N*=10
100 until N>10^9
producing:
0 0 10
1 0 10
33 12 88
100 10 990
2353 588 9412
9901 990 99010
38125 17650 82350
43776 25840 74160
321168 116788 883212
328768 123288 876712
773101 60130 9939870
990100 99010 9900990
2663025 768180 9231820
2846976 889680 9110320
3448276 1379310 8620690
3604525 1534830 8465170
10243728 1060588 98939412
12888513 1689688 98310312
15600625 2496100 97503900
17428225 3135760 96864240
25002048 6699912 93300088
27318513 8122812 91877188
31180401 10913140 89086860
38526913 18130312 81869688
40202128 20271412 79728588
42355776 23429560 76570440
45440001 29138400 70861600
46547313 31742188 68257812
47470848 34299088 65700912
48531600 37971540 62028460
49680625 44357700 55642300
... (program manually terminated)
Ignoring the first two lines, examining the next five:
33 12 88
100 10 990
2353 588 9412
9901 990 99010
38125 17650 82350
The ending digits are shown on the left and the closing digits on the right. So 1233 and 8833 are shown on the first (actually third) line. Then, for b=100, we show not only the 990100, but also 010100 = 010^2 + 100^2, which is unsatisfactory due to the leading zero, as is the case for b=9901-- with both shown prefixes. But whenever the number of digits in the middle column equals the number of digits in the left and right hand columns, there are two results for the given b, as in 1765038125 and 8235038125. ... and so on down the rest of the list, to the largest I've shown: 44357700^2+ 49680625^2 = 4435770049680625 and 55642300^2 + 49680625^2 = 5564230049680625 .
Edited on August 27, 2004, 11:42 am
|
Posted by Charlie
on 2004-08-27 11:35:24 |