Guest User

Untitled

a guest
May 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. {-
  2. - Project Euler Problem 1
  3. -
  4. - If we list all the natural numbers below 10 that are multiples of 3 or 5
  5. - we get 3, 5, 6 and 9. The sum of these multiples is 23.
  6. -
  7. - Find the sum of all the multiples of 3 or 5 below 1000.
  8. -
  9. - solution by nathan dotz
  10. - nathan (period) dotz (at sign) gmail (period) com
  11. -}
  12.  
  13. main = putStrLn $ "Sum of all multiples of 3 or 5 below 1000: "
  14. ++ show ( sum [ x | x<-[1..999], x `mod` 3 == 0 || x `mod` 5 == 0] )
Add Comment
Please, Sign In to add comment