in reply to Re: Primes. Again.
in thread Primes. Again.
I already had the first paragraph of your explanation as it is the same in essence as my solution, except that mine spends a lot of time filling out the sieve for each prime it finds. What I couldn't see to start with was why your solution was so quick. I was thinking "how can it fill in all the primes up to 36544645654 in that time?" However, as you point out, and I had managed to work out, you are only filling in the primes up to the square root of 36544645654 (191000 or so).
No wonder it is so much faster. Very nice.
Cheers,
JohnGG
|
|---|