You are viewing a single comment's thread. Return to all comments →
Sum of first 126000 primes is 10^11.
( http://wolframalpha.com/input/?i=sum+of+first+126000+primes )
For 10^12 sum you need about 380000 primes and sieve for 6*10^6. Anyway - such sieve (even simple implementation) should be pretty fast (make sure you start marking non-primes with i*i).