From 317ee36636ebeec986971ef857cd297f0320e58d Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Mon, 27 May 2013 10:31:48 +0200 Subject: start --- haskell/p5.hs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 haskell/p5.hs (limited to 'haskell/p5.hs') diff --git a/haskell/p5.hs b/haskell/p5.hs new file mode 100644 index 0000000..ccee7fe --- /dev/null +++ b/haskell/p5.hs @@ -0,0 +1,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 -- cgit v1.2.3