login
A386047
Primes having only {0, 2, 4, 7} as digits.
1
2, 7, 47, 227, 277, 727, 2027, 2207, 2447, 2477, 2707, 2777, 4007, 4027, 4447, 7027, 7207, 7247, 7477, 7727, 20047, 20407, 20477, 20707, 20747, 22027, 22247, 22277, 22447, 22727, 22777, 24007, 24077, 24247, 24407, 27077, 27277, 27407, 27427, 40277, 40427, 42227
OFFSET
1,1
MAPLE
f:= n-> (l-> add([0, 2, 4, 7][l[j]+1]*10^(j-1), j=1..nops(l)))(convert(n, base, 4)):
select(isprime, [seq(f(i), i=0..600)])[]; # Alois P. Heinz, Jul 15 2025
MATHEMATICA
Select[FromDigits /@ Tuples[{0, 2, 4, 7}, n], PrimeQ]
PROG
(Magma) [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 2, 4, 7]];
(Python) print(list(islice(primes_with("0247"), 41))) # uses function/imports in A385776
(PARI) primes_with(, 1, [0, 2, 4, 7]) \\ uses function in A385776
CROSSREFS
Supersequence of A261267, A384449, A385784.
Sequence in context: A290488 A276649 A386157 * A385784 A091117 A056854
KEYWORD
nonn,base,easy
AUTHOR
Jason Bard, Jul 15 2025
STATUS
approved