Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- multipleOf :: (Integral a) => a -> a -> Bool
- multipleOf x y
- | mod x y == 0 = True
- | otherwise = False
- sumOfList :: (Num a) => [a] -> a
- sumOfList = foldl (+) 0
- --| Find the sum of all integers under 1000 that are divisible by 3 or 5.
- euler1 = sumOfList $ filter (\x -> x `multipleOf` 3 || x `multipleOf` 5) [999,998..0]
Advertisement
Add Comment
Please, Sign In to add comment