OFFSET
1,1
COMMENTS
EXAMPLE
The prime 607 is in the sequence because 607 - 6 = 601 and 607 + 6 = 613 are both primes.
MATHEMATICA
pdQ[p_]:=Module[{c=Min[DeleteCases[IntegerDigits[p], 0]]}, AllTrue[p+{c, -c}, PrimeQ]]; Select[Prime[Range[460000]], pdQ] (* Harvey P. Dale, Feb 26 2023 *)
PROG
(PARI) s=[]; forprime(p=2, 7000000, v=vecsort(digits(p), , 8); d=v[1+!v[1]]; if(isprime(p-d) && isprime(p+d), s=concat(s, p))); s
(Python)
import sympy
from sympy import isprime
from sympy import prime
for n in range(1, 10**6):
..s=prime(n)
..lst = []
..for i in str(s):
....if i != '0':
......lst.append(int(i))
..if isprime(s+min(lst)) and isprime(s-min(lst)):
....print(s, end=', ')
# Derek Orr, Aug 13 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Colin Barker, Aug 05 2014
STATUS
approved