Skip to content

Commit

Permalink
Solution for p7 in haskell
Browse files Browse the repository at this point in the history
  • Loading branch information
bsiver committed Aug 12, 2011
1 parent 0069b58 commit adf1935
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p7.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
isPrime x = not $ any divisible $ takeWhile notTooBig [2..] where
divisible y = x `mod`y == 0
notTooBig y = y*y <= x

main = filter isPrime[1..1000000]!!10001

0 comments on commit adf1935

Please sign in to comment.