Created
August 1, 2012 04:22
-
-
Save rhysd/3223663 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = print $ sum . filter isPrime $ [2..2000000] | |
where | |
isPrime n = null $ filter (\x->n `mod` x==0) [2..floor $ sqrt $ fromIntegral n] | |
-- 142913828922 ( 11.21s with Core i5, 4G Mem ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment