Skip to content

Instantly share code, notes, and snippets.

@cmoore
Created June 18, 2009 03:42
Show Gist options
  • Save cmoore/131683 to your computer and use it in GitHub Desktop.
Save cmoore/131683 to your computer and use it in GitHub Desktop.
-- The Haskell Wiki solution to this still seems like witchcraft.
-- foldr1 lcm [1..20]
c_s :: Int -> [ Int ]
c_s x = nub $ map ( x `mod` ) [ 1..20 ]
p5_iter :: Int -> Int
p5_iter x = case length $ nub $ map ( x `mod` ) [ 1..20 ] of
1 ->
x
_ -> p5_iter (x + 1)
problem_five = p5_iter 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment