A386048 Primes having only {0, 2, 4, 9} as digits.
2, 29, 229, 409, 449, 499, 929, 2029, 2099, 2909, 2999, 4049, 4099, 4229, 4409, 4909, 4999, 9029, 9049, 9209, 9929, 9949, 20029, 20249, 20929, 22229, 22409, 24029, 24049, 24229, 24499, 29009, 29209, 29429, 40009, 40099, 40429, 40499, 40949, 42209, 42299, 42409
Offset: 1
Links
Programs
-
Magma
[p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 2, 4, 9]];
-
Maple
f:= n-> (l-> add([0, 2, 4, 9][l[j]+1]*10^(j-1), j=1..nops(l)))(convert(n, base, 4)): select(isprime, [seq(f(i), i=0..620)])[]; # Alois P. Heinz, Jul 15 2025
-
Mathematica
Select[FromDigits /@ Tuples[{0, 2, 4, 9}, n], PrimeQ]
-
PARI
primes_with(, 1, [0, 2, 4, 9]) \\ uses function in A385776
-
Python
print(list(islice(primes_with("0249"), 41))) # uses function/imports in A385776