10 for I=1 to 100
20 P=prm(I)
30 S=cutspc(str(P))
40 R=""
50 for J=1 to len(S)
60 R=mid(S,J,1)+R
70 next
80 Rev=val(R)
90 P2=P+Rev
100 if prmdiv(P2)=P2 then print P,Rev,P2
110 next
finds
prime rev new prime
229 922 1151
239 932 1171
241 142 383
257 752 1009
269 962 1231
271 172 443
277 772 1049
281 182 463
439 934 1373
443 344 787
463 364 827
467 764 1231
479 974 1453
499 994 1493
The smallest is 229.
Only primes up to the 100th prime were checked.
|
Posted by Charlie
on 2013-01-15 17:59:45 |