Created
November 1, 2014 20:02
-
-
Save ramntry/14ad433612f43b606bf7 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
| import Data.List | |
| ham :: [Integer] | |
| ham = 1 : (map head . group $ merge (map (* 3) ham) (map (* 10) ham)) where | |
| merge l1@(x : xs) l2@(y : ys) | x < y = x : merge xs l2 | |
| | otherwise = y : merge l1 ys | |
| main :: IO () | |
| main = do | |
| num' <- getLine | |
| putStrLn $ show $ ham !! read num' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment