(In reply to
re: computer solutios by Ady TZIDON)
Yes, rounding errors caused the cube roots to differ from an integer by a tiny amount in those instances. The corrected program:
5 point 5
10 for Tot=84 to 999999 step 2
20 for A=1 to int(Tot/2) step 2
30 B=Tot-A
40 Cra=A^(1/3)
50 Crb=B^(1/3)
55 Crarnd=int(Cra+0.5):Crbrnd=int(Crb+0.5)
60 if abs(Cra-Crarnd)<0.000000001 and abs(Crb-Crbrnd)<0.0000000001 and A<>B then
70 :Crc=Crb+Crb-Cra
80 :C=Crc*Crc*Crc
90 :Crnd=int(C+0.5)
100 :if abs(C-Crnd)<0.000000000001 and Crnd@2<>0 then
110 :print A,B,Crnd:Ct=Ct+1
115 :if Ct@44=0 then while inkey="":wend:print
120 next A
130 next Tot
1 125 729
27 125 343
1 343 2197
27 343 1331
125 343 729
1 729 4913
27 729 3375
125 729 2197
343 729 1331
1 1331 9261
27 1331 6859
125 1331 4913
343 1331 3375
729 1331 2197
1 2197 15625
27 2197 12167
125 2197 9261
343 2197 6859
729 2197 4913
1 3375 24389
27 3375 19683
125 3375 15625
1331 2197 3375
343 3375 12167
729 3375 9261
1331 3375 6859
1 4913 35937
27 4913 29791
125 4913 24389
343 4913 19683
2197 3375 4913
729 4913 15625
1331 4913 12167
1 6859 50653
27 6859 42875
125 6859 35937
2197 4913 9261
343 6859 29791
729 6859 24389
1331 6859 19683
3375 4913 6859
2197 6859 15625
1 9261 68921
27 9261 59319
|
Posted by Charlie
on 2013-09-29 20:00:04 |