PE 0010: Summation of Primes
The sum of the primes below
Find the sum of all the primes below two million.
Generating Primes
See the discussion on primes TODO: link for generating the sequence of prime integers. There really aren't any tricks here that I'm aware of other than approximating it with the totient function (ok, I can write a bit about that). We could sum on our way up while building the sieve (actually, was thinking of adding some callbacks into the prime utilities in golang).
Exercises
What is the largest prime that can fit into a 64-bit integer?
What is the largest sum of primes that can fit into a 64-bit integer?
What are the trade-offs when deciding between big-integer or int64/uint64 for prime factorization and prime sequence generation?