On Sun, Nov 23, 2014 at 8:42 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Sun, 23 Nov 2014 08:45:39 -0800, Rustom Mody wrote: >> First a one-line solution in haskell >> >> sieve (p:xs) = p:sieve [x | x <- xs, x `mod` p /= 0] > > Don't use that! That is a horribly inefficient way to generate primes. > > Mathematically, it is a version of Euler's Sieve. It is sometimes wrongly > described as "Sieve of Eratosthenes", but that is wrong. Due to it's > horrible performance, Melissa O'Neill calls this the "Sleight on > Eratosthenes":
I don't read Haskell, but here's a Sieve (or at least I thought it was a Sieve) and a few other prime-related things: http://stromberg.dnsalias.org/~dstromberg/primes/ -- https://mail.python.org/mailman/listinfo/python-list