Skip to content

Instantly share code, notes, and snippets.

@rhysd
Created July 26, 2012 22:58
Show Gist options
  • Save rhysd/3185120 to your computer and use it in GitHub Desktop.
Save rhysd/3185120 to your computer and use it in GitHub Desktop.
main = print . head $ [ x | x <- [1..], allDivided 20 x ]
where
allDivided 1 _ = True
allDivided n x = x `mod` n == 0 && allDivided (n-1) x
-- もっと真面目に解ける.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment