summaryrefslogtreecommitdiff
path: root/haskell/p2.hs
blob: 1d9d769071c50d93069eb988b990741c90450599 (plain) (blame)
1
2
3
4
5
6
7
8
fibs :: [Int]
fibs = list
	where list = 0 : 1 : zipWith (+) list (tail list)

p2 :: Int
p2 = sum [x | x <- takeWhile (< 4000000) fibs, mod x 2 == 0]

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