How do I find the sum of all primes up to N, that can be any natural number up to 10^11? Normally I would seive them over an array of boolean, but an array of this length would far pass my heap limit. Is there any quick way that does not require so much memory?
Thanks!