All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Cubic Equation (Posted on 2013-06-09)
Determine all triplets (a,b,c) of nonzero integers satisfying:
987654321*a + 123456789*b + c = (a + b + c)3

Prove that there are no others.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 re(4): an open letter to Charlie Comment 13 of 13 |
(In reply to re(3): an open letter to Charlie by Steve Herman)

Yes, the below program goes much faster, even in interpreted UBASIC, needed because some intermediate results used in solving for a and b exceed the capacity of QB64.

20   ' x = a+b+c
30   for X=0 to 1000000
40       Rhs=X*X*X-X
50
60       if Rhs @ 4 = 0 then
70           :A=-7716049*Rhs//4:B=61728393*Rhs//4
80           :Q=int(abs(A)/30864197)
90           :A=A+Q*30864197:B=B-Q*246913580
100           :while A<0
110           :A=A+30864197:B=B-246913580
120           :wend
130           :while B>=0
140           :C=X-A-B
150           :if C>=0 then print A,B,C
160           :A=A+30864197:B=B-246913580
170           :wend
190   next X

`0       0       00       0       1450     4500    50507350    6000    665027150   1500    1350`

About 1 second run time (under 1 second for all the solutins to appear).

The Euclidean algorithm for finding GCD was used to find the constants that multiply by the coefficients to produce the GCD, 4, and zero.

 Posted by Charlie on 2013-06-13 18:01:36

 Search: Search body:
Forums (0)