login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358685 Number of primes < 10^n whose digits are all odd. 2
3, 15, 57, 182, 790, 3217, 13298, 56866, 254689, 1128121, 5106701, 23266331, 107019385, 494689488, 2306491761, 10758057302, 50548874979 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(2) = 15 as there are 15 primes less than 100 whose digits are all odd: 3, 5, 7, 11, 13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97.
MATHEMATICA
n=7
Length[Select[Prime[Range[PrimePi[10^n]]], And @@ OddQ[IntegerDigits[#]] &]] (* Zhining Yang, Nov 26 2022 *)
n = PrimePi[10^8];
Sum[If[MemberQ[IntegerDigits[Prime[i]], _?EvenQ], 0, 1], {i, 1, n}]
(* Jianlin Su, Nov 27 2022 *)
PROG
(Python)
from sympy import primerange
def a(n):
p=list(primerange(3, 10**n))
return(sum(1 for k in p if all(int(d) %2 for d in str(k))==True))
print ([a(n) for n in range(1, 8)])
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen(): # generator of terms
c = 3
for d in count(2):
yield c
for p in product("13579", repeat=d-1):
s = "".join(p)
for last in "1379":
if isprime(int(s+last)): c += 1
print(list(islice(agen(), 9))) # Michael S. Branicky, Nov 27 2022
CROSSREFS
Sequence in context: A284014 A049187 A049161 * A118048 A210448 A284699
KEYWORD
base,nonn,more
AUTHOR
Zhining Yang, Nov 26 2022
EXTENSIONS
a(10)-a(14) from Michael S. Branicky, Nov 26 2022
a(15) from Zhining Yang, Dec 21 2022
a(16)-a(17) from Martin Ehrenstein, Dec 21 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 20 10:31 EDT 2024. Contains 373516 sequences. (Running on oeis4.)