Tuesday, August 3, 2010

Fast enough and fancy primes oneliner

primes = 2: filter(\x->not$any (\y->mod x y==0) (takeWhile (<(ceiling.sqrt$fromIntegral x+1)) primes)) [3..]
view raw niceprimes.hs hosted with ❤ by GitHub

No comments:

Post a Comment