OFFSET
0,1
COMMENTS
C1 = 'prevprime(n) followed by n followed by nextprime(n)'
C2 = 'nextprime(n) followed by n followed by prevprime(n)'
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
n=797 -> previous prime is 787, next prime is 809, thus '787797809' and '809797787' are both primes.
MATHEMATICA
c1c2Q[n_]:=Module[{ia=IntegerDigits[NextPrime[n, -1]], ib=IntegerDigits[n], ic= IntegerDigits[NextPrime[n]]}, AllTrue[{FromDigits[Join[ia, ib, ic]], FromDigits[Join[ic, ib, ia]]}, PrimeQ]]; Select[Range[1600], c1c2Q] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 06 2018 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Oct 15 1998
STATUS
approved