login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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)
print(list(afull())) # Michael S. Branicky, Nov 01 2022
CROSSREFS
Subsequence of A029743 (primes with distinct digits).
Sequence in context: A260594 A228940 A045311 * A045312 A129672 A259188
KEYWORD
nonn,base,fini,full
AUTHOR
Zak Seidov, Oct 31 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 13 08:08 EDT 2024. Contains 374274 sequences. (Running on oeis4.)