OFFSET
1,1
COMMENTS
Is this sequence infinite?
LINKS
T. D. Noe, Table of n, a(n) for n=1..10000
EXAMPLE
The prime 612041 is in the sequence because swapping the second and the penultimate digit yields 642011, which is prime.
MATHEMATICA
a = {}; For[n = 5, n < 100, n++, b = IntegerDigits[Prime[n]]; {b[[2]], b[[ -2]]} = {b[[ -2]], b[[2]]}; If[PrimeQ[FromDigits[b]], AppendTo[a, Prime[n]]]]; a
PROG
(PARI) swap(n, d) = \ d is the digit position to swap { local(j, ln, x, s, y, y2, tmp); forprime(x=10^(d-1), 10^(d-1)+n, s = Str(x); ln = length(s); y = eval(Vec(s)); tmp=y[d]; y[d]=y[ln-d+1]; y[ln-d+1]=tmp; y2=0; for(j=1, ln, y2+=y[j]*10^(ln-j); ); if(isprime(y2), print1(x", ")) ) }
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Cino Hilliard, Nov 05 2005
EXTENSIONS
Edited by Stefan Steinerberger, Aug 01 2007
STATUS
approved