OFFSET
1,1
COMMENTS
A 4-digit prime abcd is a member if cdab is also a prime. c can be zero.
A 5-digit prime abcde is a member if both cdabe and adebc are primes. Again c can be zero, but not (of course) a.
PROG
(PARI) eva(n) = subst(Pol(n), x, 10)
switchdigits(n, k) = my(d=digits(n), v=vector(2)); v[1]=d[k]; v[2]=d[k+1]; d[k]=d[k+2]; d[k+1]=d[k+3]; d[k+2]=v[1]; d[k+3]=v[2]; eva(d)
is(n) = my(i=0); for(k=1, #Str(n)-3, if(ispseudoprime(switchdigits(n, k)), i++)); if(i==#Str(n)-3, return(1), return(0))
forprime(p=1000, 2000, if(is(p), print1(p, ", ")))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Apr 07 2016
STATUS
approved