OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..300 (first 100 terms from Robert G. Wilson v)
EXAMPLE
The first three three-digit primes are: 101, 103 and 107. Their sum is 311. Hence a(3) is 311.
MAPLE
with(numtheory): a:=n->add(ithprime(pi(nextprime(10^(n-1)))+i), i=0..n-1): seq(a(n), n=1..9); # Emeric Deutsch, Jul 29 2006
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ@k, k++ ]; k]; f[n_] := Plus @@ Rest@NestList[NextPrim, 10^(n - 1), n]; Array[f, 18] (* Robert G. Wilson v, Aug 01 2006 *)
Total/@Table[Rest[NestList[NextPrime[#]&, 10^(n-1), n]], {n, 30}] (* Harvey P. Dale, Sep 01 2022 *)
PROG
(Python)
from sympy import nextprime
def a(n):
s = p = nextprime(10**(n-1))
for n in range(n-1): p = nextprime(p); s += p
return s
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Feb 24 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Tanya Khovanova, Jul 26 2006
EXTENSIONS
a(5)-a(8) from Emeric Deutsch, Jul 29 2006
a(9)-a(18) from Robert G. Wilson v, Aug 01 2006
STATUS
approved