Algorithms-ti compute sum of primes,prime(x)
cino hilliard
hillcino368 at hotmail.com
Mon Aug 14 16:46:17 CEST 2006
Hi,
I just uploaded to mathforfun some Gcc Pari and basic programs to compute
the sum of primes in a
range and to compute an approximation of prime(x) to very high accuracy.
Some of you may be
able to add improvements.
The pari routine primex(n) produces
googol=10^100
primex(googol)
=23471257358657641780361359099363020719654224259786148259852779144053794033
04282984439399437187551903374.8804209
My conjecture is that this is correct to the first 50 places. Maybe someone
has software that will
verify this.
So far, I have used sumprimes.exe to compute
n sum primes <= 10^n
1 17
2 1060
3 76127
4 5736396
5 454396537
6 37550402023
7 3203324994356
8 279209790387276
9 24739512092254535
10 2220822432581729238
11 201467077743744681014
12 18435588552550705911377
13 1699246443377779328889494
I have invented a very good formula to estimate the sum of primes in a
range. The formula
predicts that 10^14 ~ 157588560672160329790093231. It is in the code.
I am running sumprimes 10000000000000 now and estimate it will take about
22 days to
compute. When it is done and if it is in line with my formula, I will
extend A046731 with a(12),a
(13),a(14).
The sieve program used is fantastic and very memory friendly. I modified it
somewhat for this
purpose but could not improve the efficiency at all. The modification is
good for ranges up to
2^64. Also I used it (modified) to store the 22 bill+ primes < 1 trillion on
2 hard drives 300 gig+
in about 20 hours. This produces a fast prime(x) function that can be callec
from Pari.
http://groups.yahoo.com/group/mathforfun/files/Prime%20Number%20Algorithms%20/
Having fun at 2^6,
Cino
More information about the SeqFan
mailing list