Finding primes using a primes map with Haskell and Hugs98

Adrian Hey ahey@iee.org
Mon, 18 Dec 2000 00:24:12 +0000 (GMT)


On Sun 17 Dec, Adrian Hey wrote:
> You can use a variation of this algorithm with lazy lists..
>
> primes = 2:(get_primes [3,5..])
> get_primes (x:xs) = x:(get_primes (strike (x+x) (x*x) xs))
                                                   ^^^
Whoops,_____________________________________________|

32 bit Ints may cause trouble here :-)

Regards
-- 
Adrian Hey