sum of first 10^n primes A099824

Max A. maxale at gmail.com
Mon Oct 9 00:58:08 CEST 2006


On 10/4/06, cino hilliard <hillcino368 at hotmail.com> wrote:

> >sumprimes2(n) = local(s);s=0;forprime(p=2,prime(n),s+=p);s
>
> That is much faster than using prime(x) or nextprime(x)  but again, breaks
> down at n=10^8.

Under amd64 with 4GB memory I was able to set up primelimit = 10^11.
Then computing the sum of all primes below 10^11 took less than 40 minutes:

parisize = 8000000, primelimit = 100000000000
? s=0;forprime(p=2,10^11,s+=p);s
%1 = 201467077743744681014
? ##
  ***   last result computed in 39mn, 22,708 ms.

Unfortunately, pari/gp complains "not enough memory" when I'm trying
to set up primelimit=2760727302517 so I cannot verify your computation
of a(11) this way.

Max



X-From_: njas at research.att.com Mon Oct  9 02:26:38 2006



More information about the SeqFan mailing list