Disclaimer: I'm working on Euler Problem 9.
I'm adding up some pretty large numbers, all the primes from 1 to 2 000 000.
Summing those primes takes forever. I'm using the haskell built in function 'sum'.
as in:
sum listOfPrimes
Are there any other faster options?
--My prime generator was the slow link in my code.
It sounds like your problem is not summing the numbers, but generating them. What is your implementation of listOfPrimes?
This paper may be of interest: http://lambda-the-ultimate.org/node/3127
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With