OFFSET
1,1
COMMENTS
Only 656 primes have this property in the first 60000000 primes.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..656
EXAMPLE
37957, 137957, 1037957, 10037957, 100037957, 1000037957 are all prime numbers. Hence, a(1) = 37957 as it is the smallest prime with this property.
PROG
(PFGW & SCRIPTIFY) the file prem.txt with the 60000000 first primes
SCRIPT
DIM mm, 1
DIM n
DIM ss, 0
DIM cc
DIM pp
DIM qq
DIMS t
OPENFILEIN myf, prem.txt
OPENFILEOUT myfile, a(1).txt
LABEL a
GETNEXT qq, myf
IF qq>10^mm THEN SET mm, mm+1
SET ss, ss+1
SET cc, 1
SET n, 0
LABEL b
SET n, n+1
SET pp, qq+10^(n+mm)
SETS t, %d, %d\,; pp; cc
PRP pp, t
IF ISPRP THEN SET cc, cc+1
IF ISPRP THEN GOTO b
IF ss>59999999 THEN END
IF cc<6 THEN GOTO a
SETS t, %d, %d\,; qq; cc
WRITE myfile, t
GOTO a
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 25 2013
STATUS
approved