Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The problem: 2520 is the smallest number that can be divided by
- -- each of the numbers from 1 to 10 without any remainder. What is the
- -- smallest positive number that is evenly divisible by all of the
- -- numbers from 1 to 20?
- main :: IO ()
- main =
- print $
- head
- [ x
- | x <- [20,40 .. product [11 .. 20]]
- , null [y | y <- [11 .. 20], mod x y /= 0]
- ]
- -- 232792560
- -- real 0m3,226s
- -- user 0m3,201s
- -- sys 0m0,017s
Add Comment
Please, Sign In to add comment