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
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
- Finding primes using a primes map with Haskell and Hugs... Shlomi Fish
- Re: Finding primes using a primes map with Haskell... Joe English
- Re: Finding primes using a primes map with Haskell... Adrian Hey
- RE: Finding primes using a primes map with Haskell... Elke Kasimir
- RE: Finding primes using a primes map with Haskell... Adrian Hey
- RE: Finding primes using a primes map with Haskell... Simon Peyton-Jones
- RE: Finding primes using a primes map with Haskell... Shlomi Fish
- Re: Finding primes using a primes map with Has... George Russell
- Re: Finding primes using a primes map with Has... Hannah Schroeter
- Re: Finding primes using a primes map with Haskell... Colin . Runciman
