A348699 Primes with a prime number of prime digits.
23, 37, 53, 73, 127, 137, 157, 173, 223, 227, 229, 233, 239, 251, 257, 263, 271, 277, 283, 293, 307, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 397, 433, 457, 503, 521, 523, 547, 557, 563, 571, 577, 587, 593, 653, 673, 677, 727, 733, 739, 743, 751, 757, 773, 787, 797
Offset: 1
Links
- Jens Ahlström, Table of n, a(n) for n = 1..5853 (all terms < 10^5)
- Hackerearth, Optimus prime
Programs
-
Mathematica
Select[Range[800], And @@ PrimeQ[{#, Count[IntegerDigits[#], ?PrimeQ]}] &] (* _Amiram Eldar, Nov 04 2021 *)
-
Python
from sympy import isprime as i from sympy import primerange as p print([x for x in p(1, 800) if i(len([d for d in str(x) if i(int(d))]))])
-
Python
from sympy import isprime def ok(n): return isprime(n) and isprime(sum(1 for d in str(n) if d in "2357")) print([k for k in range(800) if ok(k)]) # Michael S. Branicky, Jun 26 2025