Created
June 15, 2012 09:23
-
-
Save ehamberg/2935580 to your computer and use it in GitHub Desktop.
Programming Praxis, 15 June 2012
This file contains 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 qualified Data.MemoCombinators as Memo | |
f = Memo.integral f' | |
where f' :: Int -> Int | |
f' 1 = 1 | |
f' n = (length . filter (== '1') . show) n + f (n-1) | |
main = (print . head . filter (uncurry (==))) $ zip [2..] $ map f [2..] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment