OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000 (first 1000 terms from Vincenzo Librandi)
James Maynard and Brady Haran, Primes without a 7, Numberphile video (2019)
MATHEMATICA
Flatten[Table[Select[FromDigits/@Tuples[{4, 7}, n], PrimeQ], {n, 8}]] (* Vincenzo Librandi, Jul 27 2012 *)
PROG
(Magma) [p: p in PrimesUpTo(47774747) | Set(Intseq(p)) subset [4, 7]]; // Vincenzo Librandi, Jul 27 2012
(Python)
from sympy import isprime
from itertools import count, takewhile
def A284971(n):
b = bin(n+1)[3:]
return int("".join(b.replace("0", "4").replace("1", "7")))
def aupto(limit):
return list(filter(isprime, takewhile(lambda x: x <= limit, (A284971(n) for n in count(1)))))
print(aupto(47774747)) # Michael S. Branicky, Apr 07 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved