f300 :: [Int] f300 = [0,1] ++ f 1 where f n = replicate (f300 !! n) n ++ f (n+1) main :: IO () main = print $ map (f300 !!) [10,100,1000,12345678]