summaryrefslogtreecommitdiff
path: root/haskell/p5.hs
diff options
context:
space:
mode:
authorGuillermo Ramos2013-05-27 10:31:48 +0200
committerGuillermo Ramos2013-05-27 10:31:48 +0200
commit317ee36636ebeec986971ef857cd297f0320e58d (patch)
tree88c10fdbf166beae22f6c9d6c79970ae2240f4b0 /haskell/p5.hs
downloadeuler-317ee36636ebeec986971ef857cd297f0320e58d.tar.gz
start
Diffstat (limited to 'haskell/p5.hs')
-rw-r--r--haskell/p5.hs8
1 files changed, 8 insertions, 0 deletions
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