Hello everybody.
A while ago I implemented the prime number finder of Problem 10, the second version, which discriminates even numbers.
My question: is it worth pursuing further optimization, by also cutting out numbers divisible by 3, 5, 7, 11, 13, etc?
(Obviously, only up to a reasonable value.)
Optimizing Eratosthenes' Sieve... more?
- Lord_Farin
- Posts: 239
- Joined: Wed Jul 01, 2009 10:43 am
- Location: Netherlands
Re: Optimizing Eratosthenes' Sieve... more?
I cut it for three also, but the management is tedious and very hard to get correct.
Obviously, there is a speed effect, and since one needs less memory as well (cutting one third, of course), there is really something to be gained here.
Obviously, there is a speed effect, and since one needs less memory as well (cutting one third, of course), there is really something to be gained here.
