isPrime n = fact !! (fromInteger (n-1)) `mod` n == n-1 fact = 1 : zipWith (*) fact [1..] main = print . sum $ filter (not.isPrime) [1..10000]
Standard input is empty
44268603
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!