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!)
A079155 The number of primes less than 10^n whose digital root (A038194) is also prime. 0
4, 15, 85, 619, 4800, 39266, 332276, 2880818, 25423985, 227527467 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(2) = 15 because the only primes less than 100 whose have digital roots are also prime are {2,3,5,7,11,23,29,41,43,47,59,61,79,83,97}.
MATHEMATICA
c = 0; k = 1; Do[ While[ k < 10^n, If[ PrimeQ[k] && PrimeQ[ Mod[k, 9]], c++ ]; k++ ]; Print[c], {n, 1, 8}]
PROG
(Python)
# use primerange (slower) vs. sieve.primerange (>> memory) for larger terms
from sympy import isprime, sieve
def afind(terms):
s = 0
for n in range(1, terms+1):
s += sum(isprime(p%9) for p in sieve.primerange(10**(n-1), 10**n))
print(s, end=", ")
afind(7) # Michael S. Branicky, Apr 15 2021
CROSSREFS
The primes are in A078403, their digital roots are in A078400.
Sequence in context: A107874 A237627 A034496 * A306178 A304920 A076900
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Dec 27 2002
EXTENSIONS
a(9)-a(10) from Michael S. Branicky, Apr 15 2021
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 April 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)