|
|
A020465
|
|
Primes that contain digits 4 and 7 only.
|
|
5
|
|
|
7, 47, 4447, 7477, 44777, 47777, 74747, 77447, 77477, 77747, 4444747, 4447747, 4747747, 4774477, 4774747, 7444477, 7447777, 7474477, 7477777, 7747477, 7774777, 7777447, 44447747, 44747447, 44747777, 44774777, 47447747, 47774477, 47774747
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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
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)))))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|