login
A099824
a(n) = Sum of the first 10^n primes.
9
2, 129, 24133, 3682913, 496165411, 62260698721, 7472966967499, 870530414842019, 99262851056183695, 11138479445180240497, 1234379338586942892505, 135436174616790289414111, 14738971133550183905879827, 1593061976858155930556059673, 171191473337951767580578821529
OFFSET
0,1
LINKS
David Baugh, Table of n, a(n) for n = 0..23 [terms a(0)-a(17) from Marc Deleglise; terms a(18)-a(21) from Kim Walisch]
Cino Hilliard, SumPrimes, June 2008. [broken link]
FORMULA
a(n) = Sum_{i=1..10^n} A000040(i). - José de Jesús Camacho Medina, Dec 27 2014 (corrected by Joerg Arndt, Jan 05 2015)
EXAMPLE
For n=1, the sum of the first 10^1 = 10 primes is 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 = 129, so a(1) = 129. - Michael B. Porter, Aug 08 2016
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; k = p = 1; s = 0; Do[ While[p = NextPrim[p]; s = s + p; k < 10^n, k++ ]; k++; Print[s], {n, 0, 8}]
Table[Sum[Prime[i], {i, 10^n}], {n, 0, 5}] (* José de Jesús Camacho Medina, Dec 27 2014 *)
PROG
(PARI) vecA099824(n)={ my(s, c, k=1, L:list); L=List();
forprime(m=2, prime(10^n), s+=m; c++; if(c==k, listput(L, s); k*=10));
return(vector(#L, i, L[i]))} \\ R. J. Cano, Aug 12 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Oct 25 2004
EXTENSIONS
a(9) from Hans Havermann, May 06 2005
a(10) from Cino Hilliard, Apr 28 2006
a(11) from Cino Hilliard, Oct 03 2006
a(12)-a(13) from Hiroaki Yamanouchi, Jul 06 2014
a(11) corrected by Marc Deleglise, Apr 03 2016
a(14)-a(17) from Marc Deleglise, Apr 03 2016
a(18)-a(20) from Kim Walisch, Jun 05 2016
a(21) from Kim Walisch, Jun 11 2016
a(22) from David Baugh using Kim Walisch's primesum program, Jun 21 2016
a(23) from David Baugh using Kim Walisch's primesum program, Sep 26 2016
STATUS
approved