A099825
Sum of the first 2^n primes.
Original entry on oeis.org
2, 5, 17, 77, 381, 1851, 8893, 41741, 191755, 868151, 3875933, 17120309, 74950547, 325590115, 1405167561, 6029676711, 25750781177, 109495928099, 463852117169, 1958476902435, 8244703036797, 34615624751259, 144991244981985, 605994279458465, 2527803622205465
Offset: 0
-
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[0] = 2; f[n_] := f[n] = Block[{k = 0, mx = 2^n/2, np = Prime[2^n/2], s = f[n - 1]}, While[k < mx, k++; np = NextPrim@np; s = s + np]; s]; Table[ f@n, {n, 0, 23}] (* Robert G. Wilson v, Aug 24 2006 *)
Module[{nn=22,ap},ap=Accumulate[Prime[Range[2^nn]]];Table[ap[[2^n]],{n,0,nn}]] (* Harvey P. Dale, Apr 12 2017 *)
-
a(n)=my(s); n=2^n; forprime(p=2,, s+=p; if(n--==0, return(s))) \\ Charles R Greathouse IV, Feb 16 2017 \\ corrected by David A. Corneth, Aug 05 2025
A099824
a(n) = Sum of the first 10^n primes.
Original entry on oeis.org
2, 129, 24133, 3682913, 496165411, 62260698721, 7472966967499, 870530414842019, 99262851056183695, 11138479445180240497, 1234379338586942892505, 135436174616790289414111, 14738971133550183905879827, 1593061976858155930556059673, 171191473337951767580578821529
Offset: 0
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
-
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 *)
-
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
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
A113633
Sum of the first 5^n primes.
Original entry on oeis.org
2, 28, 1060, 39612, 1336090, 42157238, 1271530648, 37178373556, 1062895088910, 29878892909030, 828999068943506, 22762324818835316, 619715756464336328, 16753554900339748756, 450233110894196298638, 12038074430656287496566, 320451759639384414082274, 8497567719126134980044214
Offset: 0
The first 5^1 primes add up to 28.
-
t = {}; c = 1; k = 3; s = 2; Do[ While[c < 5^n, If[PrimeQ[k], c++; s += k]; k += 2]; Print@s; AppendTo[t, s], {n, 0, 10}]; t (* Robert G. Wilson v, Jan 17 2006 *)
A113634
Sum of the first 6^n primes.
Original entry on oeis.org
2, 41, 2427, 132059, 6426919, 291627051, 12646104721, 531741567755, 21868328382007, 884528298065271, 35319715358896709, 1395934334687210019, 54710988941767714851, 2129404515458094306737, 82391816104703313499231, 3171892875586735205701385, 121577571158289668158700601
Offset: 0
The first 6^1 primes add up to 41.
-
t = {}; c = 1; k = 3; s = 2; Do[While[c < 6^n, If[PrimeQ@k, c++; s += k]; k += 2]; Print@s; AppendTo[t, s], {n, 0, 9}]; t (* Robert G. Wilson v, Jan 17 2006 *)
A113635
Sum of the first 7^n primes.
Original entry on oeis.org
2, 58, 4888, 363288, 24047406, 1482656786, 87401659166, 4997438572618, 279544493456056, 15382405126365576, 835737977869494888, 44947274043643171988, 2397349106561086277820, 126986150948361831547964, 6687136917574958175921116, 350384258762032443770716600
Offset: 0
The first 7^1 primes add up to 58.
-
t = {}; c = 1; k = 3; s = 2; Do[While[c < 7^n, If[ PrimeQ@k, c++; s += k]; k += 2]; Print@s; AppendTo[t, s], {n, 0, 9}]; t (* Robert G. Wilson v, Jan 17 2006 *)
Table[Total[Prime[Range[7^n]]],{n,0,7}] (* The program generates the first 8 terms of the sequence. *) (* Harvey P. Dale, Jan 18 2024 *)
Showing 1-5 of 5 results.
Comments