OFFSET
1,1
COMMENTS
This sequence has 1843 terms, the last being 927368041.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..1843
EXAMPLE
For last term: p = 927368041, q = 927368051, q-p = 10, q+p = 1854736092.
PROG
(Python)
from sympy import isprime, nextprime
from itertools import combinations, permutations
def distinct(n): s = str(n); return len(s) == len(set(s))
def afull():
for d in range(1, 10):
s = set()
for p in permutations("0123456789", d):
if p[0] == "0": continue
p = int("".join(p))
if not isprime(p): continue
q = nextprime(p)
if not all(distinct(t) for t in [q, q-p, q+p]): continue
s.add(p)
yield from sorted(s)
print(list(afull())) # Michael S. Branicky, Nov 01 2022
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Zak Seidov, Oct 31 2022
STATUS
approved