Guest User

Untitled

a guest
Oct 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. import qualified Data.MemoCombinators as Memo
  2.  
  3. f = Memo.integral f'
  4. where f' :: Int -> Int
  5. f' 1 = 1
  6. f' n = (length . filter (== '1') . show) n + f (n-1)
  7.  
  8. main = (print . head . filter (uncurry (==))) $ zip [2..] $ map f [2..]
Add Comment
Please, Sign In to add comment