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!)
A099825 Sum of the first 2^n primes. 6

%I #12 Apr 12 2017 04:43:19

%S 2,5,17,77,381,1851,8893,41741,191755,868151,3875933,17120309,

%T 74950547,325590115,1405167561,6029676711,25750781177,109495928099,

%U 463852117169,1958476902435,8244703036797,34615624751259,144991244981985

%N Sum of the first 2^n primes.

%H Robert G. Wilson v, <a href="/A099825/b099825.txt">Table of n, a(n) for n = 0..30</a>

%H C. Hilliard, <a href="http://groups.msn.com/First300billionprimes/sumprimeslt2n.msnw">Sumprimes</a>.

%t 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 *)

%t Module[{nn=22,ap},ap=Accumulate[Prime[Range[2^nn]]];Table[ap[[2^n]],{n,0,nn}]] (* _Harvey P. Dale_, Apr 12 2017 *)

%o (PARI) a(n)=my(s); forprime(p=2,, s+=p; if(n--==0, return(s))) \\ _Charles R Greathouse IV_, Feb 16 2017

%Y Cf. A000040, A006988, A007504, A099824, A099826, A121248.

%K nonn

%O 0,1

%A _Robert G. Wilson v_, Oct 25 2004

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 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)