The UBASIC program:
10 P1=nxtprm(9999)
20 P2=nxtprm(P1)
30 P3=nxtprm(P2)
40 while P3<100000
50 P2t=cutspc(str(P2))
55 Good=1
60 for I=1 to int(len(P2t)/2)
70 if mid(P2t,I,1)<>mid(P2t,len(P2t)-I+1,1) then Good=0
80 next
90 if Good then
100 :P4=P1+P2+P3
110 :if nxtprm(P4-1)=P4 then
120 :P4t=cutspc(str(P4))
130 :for I=1 to int(len(P4t)/2)
140 :if mid(P4t,I,1)<>mid(P4t,len(P4t)-I+1,1) then Good=0:endif
150 :next
160 :if Good then print P1;P2;P3;P4
170 P1=P2:P2=P3:P3=nxtprm(P2)
180 wend
finds A,B,C and D as:
10499 10501 10513 31513
|
Posted by Charlie
on 2006-01-16 09:40:56 |