The following program determines that z can be no larger than 14, as, if it were, then even only a 1 unit difference with y would make z^4-y^4 be longer than 4 digits:
list
10 for Z=10 to 10000
20 Diff=Z^4-(Z-1)^4
25 print Z,Diff
30 if Diff>9999 then print Z:end
40 next
OK
run
10 3439
11 4641
12 6095
13 7825
14 9855
15 12209
15
No for(next)
That leads to the following program and its run:
list
10 for X=1 to 12
20 for Y=X+1 to 13
30 for Z=Y+1 to 14
40 News=cutspc(str(Y^4-X^4))
50 Less=cutspc(str(Z^4-Y^4))
60 Good=1
70 if len(News)<>4 or len(Less)<>4 then Good=0
80 if Good then
90 :for I=1 to 3
100 :if instr(I+1,News,mid(News,I,1))>0 then Good=0:endif
110 :next
120 :if mid(Less,3,1)<>mid(Less,4,1) then Good=0:endif
130 :if mid(Less,3,1)<>mid(News,4,1) then Good=0:endif
140 :if mid(Less,2,1)<>mid(News,2,1) then Good=0:endif
150 :if instr(2,Less,mid(Less,1,1))>0 then Good=0:endif
160 :if instr(News,mid(Less,1,1))>0 then Good=0:endif
170 :if Good then print X;Y;Z,News;" ";Less
180 next
190 next
200 next
OK
run
12 13 14 7825 9855
OK
So (x,y,z) can only be (12,13,14). WELL is 2899.
The program did not check for the integers x, y and z to be in arithmetic sequence, but the only set that fit the other criteria were in fact in arithmetic sequence.
In fact, even if we allowed x, y and z to be any digits between 0 and 14 without regard to which is largest or smallest, there are no further solutions.
|
Posted by Charlie
on 2009-04-15 13:48:49 |