OFFSET
0,1
COMMENTS
C1 = 'prevprime(n) followed by nextprime(n)'
C2 = 'nextprime(n) followed by prevprime(n)'
EXAMPLE
n=17 -> next prime is 19, previous prime is 13, thus '1319' and '1913' are both primes.
MATHEMATICA
c1c2pQ[n_]:=Module[{c1=NextPrime[n, -1], c2=NextPrime[n]}, AllTrue[ {c1* 10^IntegerLength[ c2]+c2, c2*10^IntegerLength[c1]+c1}, PrimeQ]]; Select[ Range[600], c1c2pQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 23 2019 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Oct 15 1998
STATUS
approved