login
Start of the first run of n or more consecutive primes using only prime digits.
1

%I #41 Mar 25 2022 06:27:44

%S 2,2,2,2,2575723,7533777323,277535577223,5323733533375237,

%T 57552737757357223

%N Start of the first run of n or more consecutive primes using only prime digits.

%C This is a variant of A352312. - _Bernard Schott_, Mar 24 2022

%H Chris K. Caldwell and G. L. Honaker, Jr., <a href="https://primes.utm.edu/curios/page.php?curio_id=41445">Prime Curios! 277535577223</a>

%e a(1) = 2 because it is the first prime using only prime digits.

%e a(2) = 2 because 2, 3 is the first pair of consecutive primes using only prime digits.

%e a(5) = 2575723 because 2575723, 2575733, 2575753, 2575757, 2575777 is the first run of 5 consecutive primes using only prime digits.

%o (Python)

%o from sympy import nextprime, isprime

%o from itertools import count, islice, product

%o def onlypd(n): return set(str(n)) <= set("2357")

%o def agen():

%o adict = {i:2 for i in range(1, 5)}

%o for i in range(1, 5): yield 2

%o for digits in count(2):

%o for p in product("2357", repeat=digits-1):

%o for end in "37":

%o t0 = t = int("".join(p) + end)

%o run = 0

%o while isprime(t):

%o run += 1

%o t = nextprime(t)

%o if not onlypd(t): break

%o if run not in adict:

%o for r in range(max(adict)+1, run+1):

%o adict[r] = t0

%o yield t0

%o print(list(islice(agen(), 6))) # _Michael S. Branicky_, Mar 11 2022

%Y Cf. A019546, A082755, A352312.

%K nonn,base,hard,more

%O 1,1

%A _Metin Sariyar_, Apr 16 2021

%E a(8) from _Daniel Suteu_, Apr 22 2021

%E a(9) from _Michael S. Branicky_, Mar 15 2022