A385773 Primes having only {1, 2, 5} as digits.
2, 5, 11, 151, 211, 251, 521, 1151, 1511, 2111, 2221, 2251, 2521, 2551, 5521, 11251, 11551, 12211, 12251, 12511, 15121, 15511, 15551, 21121, 21211, 21221, 21521, 22111, 22511, 25111, 25121, 51151, 51511, 51521, 51551, 52121, 52511, 55511, 111121, 111211
Offset: 1
Links
Programs
-
Magma
[p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [1, 2, 5]];
-
Mathematica
Flatten[Table[ Select[FromDigits /@ Tuples[{1, 2, 5}, n], PrimeQ], {n, 7}]]
-
PARI
primes_with(, 1, [1, 2, 5]) \\ uses function in A385776
-
Python
print(list(islice(primes_with("125"), 41))) # uses function/imports in A385776