The primes are 19 and 89:
n (n+1)^2 (n+1)^2+1 ((n+1)^2+1)^2 palindromic
also prime sum
19 400 401 160801 268862
89 8100 8101 65626201 75888857
10 while N<100
20 N=nxtprm(N)
30 Sq=(N+1)^2
40 Pr=Sq+1
50 if prmdiv(Pr)=Pr then
60 :Prsq=Pr*Pr:P2=Prsq
70 :Revd=0
80 :while P2>0
90 :Revd=10*Revd+P2@10:P2=P2\10
100 :wend
110 :Pal=Prsq+Revd
120 :S=cutspc(str(Pal))
130 :Good=1
140 :for I=1 to int(len(S)/2)
150 :if mid(S,I,1)<>mid(S,len(S)+1-I,1) then Good=0:endif
160 :next I
170 :if Good then print N;Sq;Pr;Prsq;Pal
180 wend
|
Posted by Charlie
on 2008-12-27 23:47:41 |