A214703 Primes having only {2, 3, 5} as digits.
2, 3, 5, 23, 53, 223, 233, 353, 523, 2333, 3253, 3323, 3533, 5233, 5323, 5333, 23333, 25253, 25523, 32233, 32323, 32353, 32533, 33223, 33353, 33533, 35323, 35353, 35533, 52223, 52253, 52553, 53233, 53323, 53353, 55333, 222323, 222533, 222553, 223253, 225223
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Vincenzo Librandi)
- Index to entries for primes with digits in a given set
Programs
-
Magma
[p: p in PrimesUpTo(300000) | Set(Intseq(p)) subset [2,3,5]];
-
Mathematica
Flatten[Table[Select[FromDigits/@Tuples[{2,3,5},n],PrimeQ],{n,7}]]
-
Python
from sympy import isprime from itertools import count, islice, product def agen(): yield from (k for d in count(1) for k in (int("".join(p)) for p in product("235", repeat=d)) if isprime(k)) print(list(islice(agen(), 41))) # Michael S. Branicky, Dec 04 2022
Comments