Re: [Haskell-cafe] Genuine Eratosthenes sieve [Was: Optimization fun]

2007-02-12 Thread Yitzchak Gale
[EMAIL PROTECTED] wrote: Still, in the interest of purity, here it is, in Haskell. As the original Eratosthenes sieve, this algorithm uses only successor and predecessor operations. I don't think the Greeks had too much trouble with addition. If that is the case, then Rafael's definition is st

[Haskell-cafe] Genuine Eratosthenes sieve [Was: Optimization fun]

2007-02-11 Thread oleg
It has been already remarked that any algorithm of finding prime numbers that uses division or `mod` operations cannot be called (Eratosthenes) sieve. The insight of Eratosthenes is finding primes without resorting to division or multiplication. In his time, doing either of those operations was qu