OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
MATHEMATICA
Flatten[Table[Select[FromDigits/@Tuples[{5, 7}, n], PrimeQ], {n, 8}]]
PROG
(Magma) [p: p in PrimesUpTo(55755757 ) | Set(Intseq(p)) subset [5, 7]]; // Vincenzo Librandi, Jul 27 2012
(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 "57")
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(33)) # Michael S. Branicky, May 07 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved