OFFSET
1,1
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The prime 263 is in the sequence because 263 - 6 = 257 and 263 + 6 = 269 are both primes.
MATHEMATICA
pdpQ[n_]:=Module[{m=Max[IntegerDigits[n]]}, AllTrue[n+{m, -m}, PrimeQ]]; Select[ Prime[Range[11000]], pdpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 13 2017 *)
PROG
(PARI) select(p->d=vecsort(digits(p), , 4)[1]; isprime(p-d) && isprime(p+d), primes(20000))
(Python)
import sympy
from sympy import prime
from sympy import isprime
for n in range(1, 10**5):
..s=prime(n)
..lst = []
..for i in str(s):
....lst.append(int(i))
..if isprime(s+max(lst)) and isprime(s-max(lst)):
....print(s, end=', ')
# Derek Orr, Aug 13 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Colin Barker, Aug 05 2014
STATUS
approved