%I #14 Mar 15 2022 14:42:03
%S 7,223,37253,2,2575723,7533777323,277535577223,5323733533375237,
%T 57552737757357223
%N Start of the first run of exactly n consecutive primes using only prime digits.
%C This is a variant of A343471.
%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) = 7 because it is the first prime using only prime digits and whose next prime 11 does not use only prime digits.
%e a(3) = 37253 because 37253, 37273, 37277 is the first run of 3 consecutive primes using only prime digits, then next prime 37307 has a digit 0.
%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, n = {1:7, 4:2}, 1
%o yield 7
%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 adict[run] = t0
%o if run > n:
%o for r in range(n+1, run+1):
%o if r in adict:
%o yield adict[r]
%o n += 1
%o print(list(islice(agen(), 6))) # _Michael S. Branicky_, Mar 11 2022
%Y Cf. A082755, A343471.
%Y Subsequence of A019546.
%K nonn,base,more
%O 1,1
%A _Bernard Schott_, Mar 11 2022
%E a(9) from _Michael S. Branicky_, Mar 15 2022
|