Created
June 18, 2009 03:42
-
-
Save cmoore/131683 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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