OFFSET
0,1
COMMENTS
C1 = 'nextprime(n) followed by n'
C2 = 'n followed by prevprime(n)'
C3 = 'nextprime(n) followed by n followed by prevprime(n)'
EXAMPLE
n=95967 -> next prime is 95971, previous prime is 95959, thus '9597195967' and '9596795959' and '959719596795959' are all three primes.
MATHEMATICA
ccatQ[n_]:=Module[{idn=IntegerDigits[n], pp=IntegerDigits[NextPrime[n, -1]], np= IntegerDigits[ NextPrime[n]]}, And@@PrimeQ[{FromDigits[ Join[np, idn]], FromDigits[Join[idn, pp]], FromDigits[Join[np, idn, pp]]}]]; Select[ Range[300000], ccatQ] (* Harvey P. Dale, Sep 09 2011 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Oct 15 1998
STATUS
approved