OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
James Maynard and Brady Haran, Primes without a 7, Numberphile video (2019)
MATHEMATICA
Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {1, 5, 7}] == {} &]
PROG
(Magma) [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [1, 5, 7]];
(Python)
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
def aupton(terms):
n, digits, alst = 0, 1, []
while len(alst) < terms:
mpstr = "".join(d*digits for d in "157")
for mp in multiset_permutations(mpstr, digits):
t = int("".join(mp))
if isprime(t): alst.append(t)
if len(alst) == terms: break
else: digits += 1
return alst
print(aupton(44)) # Michael S. Branicky, May 07 2021
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Vincenzo Librandi, Aug 02 2015
STATUS
approved