A386097 Primes having only {1, 2, 5, 8} as digits.
2, 5, 11, 151, 181, 211, 251, 281, 521, 811, 821, 881, 1151, 1181, 1511, 1811, 2111, 2221, 2251, 2281, 2521, 2551, 2851, 5281, 5521, 5581, 5821, 5851, 5881, 8111, 8221, 8521, 8581, 8821, 11251, 11551, 11821, 12211, 12251, 12281, 12511, 12821, 15121, 15511, 15551
Offset: 1
Links
Programs
-
Magma
[p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [1, 2, 5, 8]];
-
Mathematica
Flatten[Table[Select[FromDigits /@ Tuples[{1, 2, 5, 8}, n], PrimeQ], {n, 7}]]
-
PARI
primes_with(, 1, [1, 2, 5, 8]) \\ uses function in A385776
-
Python
print(list(islice(primes_with("1258"), 41))) # uses function/imports in A385776