summaryrefslogtreecommitdiff
path: root/haskell/p5.hs
blob: ccee7feef6a891ca264569dd9bdb30b76eee7c84 (plain) (blame)
1
2
3
4
5
6
7
8
p5' :: Integer
p5' = foldl lcm 1 [1..20]

p5 :: Integer
p5 = head $ filter cond [1..]
	where cond n = null [x | x <- [2..20], mod n x /= 0]

main = putStrLn $ "Solution: " ++ show p5