Finding primes using a primes map with Haskell and Hugs98
Wed, 20 Dec 2000 14:49:30 GMT

> There are numerous ways of optimising sieving for primes, none of which
> have much to do with this list.  For example, two suggestions:
> (1) for each k modulo 2*3*5*7, if k is divisible by 2/3/5 or 7, ignore, otherwise
>     sieve separately for this k on higher primes.  (Or you might use products of
>     more or less primes, depending on memory and how high you were going.)
> ...
> I don't really see why any of this has anything to do with Haskell though.
> When it comes to seriously icky bit-twiddling algorithms I don't think Haskell
> has much to offer over C, especially as you'd have to make everything unboxed if
> you want comparable speed.

Forgive the self-reference, but the following short article is
all about this very topic:

C. Runciman,
Lazy wheel sieves and spirals of primes,
Journal of Functional Programming, v7, n2, pp219--226,
March 1997.