(In reply to
an open letter to Charlie by Ady TZIDON)
I will see how long the following takes:
DEFDBL A-Z
FOR t = 995 TO 31427
IF t MOD 1000 = 0 THEN PRINT t;
term1 = 0
FOR a = 1 TO t - 2
term1 = term1 + 987654321
term2 = 0
FOR b = 1 TO t - a - 1
term2 = term2 + 123456789
c = t - a - b
lhs = term1 + term2 + c
rhs = t * t * t
IF lhs = rhs THEN
PRINT
PRINT a; b; c, lhs
END IF
NEXT
NEXT a
NEXT t
Notice also I eliminated the redundant sum, when t already had that sum.
|
Posted by Charlie
on 2013-06-10 21:35:38 |