|
|
A356196
|
|
Consider pairs of consecutive primes {p,q} such that p, q, q-p and q+p all with distinct digits. Sequence gives lesser primes p.
|
|
2
|
|
|
2, 3, 5, 13, 17, 19, 23, 29, 31, 37, 41, 43, 59, 61, 67, 73, 79, 83, 89, 103, 107, 137, 157, 167, 173, 193, 239, 241, 251, 257, 263, 269, 281, 283, 359, 389, 397, 401, 419, 421, 457, 461, 463, 467, 487, 523, 601, 613, 617, 619, 641, 643, 683
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
This sequence has 1843 terms, the last being 927368041.
|
|
LINKS
|
|
|
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)
|
|
CROSSREFS
|
Subsequence of A029743 (primes with distinct digits).
|
|
KEYWORD
|
nonn,base,fini,full
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|