A386096 Primes having only {1, 2, 5, 7} as digits.
2, 5, 7, 11, 17, 71, 127, 151, 157, 211, 227, 251, 257, 271, 277, 521, 557, 571, 577, 727, 751, 757, 1117, 1151, 1171, 1217, 1277, 1511, 1571, 1721, 1777, 2111, 2221, 2251, 2521, 2551, 2557, 2711, 2777, 5171, 5227, 5521, 5527, 5557, 5711, 5717, 7121, 7127, 7151
Offset: 1
Links
Programs
-
Magma
[p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [1, 2, 5, 7]];
-
Mathematica
Flatten[Table[Select[FromDigits /@ Tuples[{1, 2, 5, 7}, n], PrimeQ], {n, 7}]]
-
PARI
primes_with(, 1, [1, 2, 5, 7]) \\ uses function in A385776
-
Python
print(list(islice(primes_with("1257"), 41))) # uses function/imports in A385776