#Haskell, <s>154</s> 149 bytes import Data.List a@(r,x)%y|length r==10=a|0<1=(\t->(union r t,x++(y\\t)))$[t|t<-tails x,isPrefixOf t y]!!0 h n=snd$foldl(%)("","")$map show[n,n-1..1] adding in the recycling-checking cost <b>a lot</b> of characters... sigh golfed a bit by using the fact that `union` does some `nub`-ing for us so that checking if we recycled all digits can become checking if the amount of the recycled digits is 10 (and also using `union` is shorter in and of itsef). example output: *Main> h 110 "110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"