OFFSET
1,2
COMMENTS
The sequence has exactly 14174521 terms, 999999999 is the last and largest. - Reinhard Zumkeller, Jul 04 2012
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
If n=22 (2 digits), f(n) = empty. If n=230 (3 digits), f(n)=20, f(f(n))=0. If n=301 (3 digits), f(n)=1 (1 digit), f(f(n))=empty.
The last 12 terms are: 999999333, 999999900, 999999901, 999999909, 999999912, 999999919, 999999920, 999999921, 999999922, 999999990, 999999991, 999999999.
MATHEMATICA
zeroQ[n_] := FixedPoint[ Function[{k}, DeleteCases[id = IntegerDigits[k], Length[id]] // FromDigits[#, 10]&], n] == 0; Select[Range[10^4], zeroQ] (* Jean-François Alcover, Dec 10 2014 *)
PROG
(Haskell)
import Data.List ((\\))
a038528 n = a038528_list !! (n-1)
a038528_list = gen ([1], 1) where
gen (_, 10) = []
gen (ds, len)
| len `elem` ds && chi ds
= foldr (\u v -> u + 10*v) 0 ds : gen (succ (ds, len))
| otherwise = gen (succ (ds, len))
chi xs = null ys || ys /= xs && chi ys where
ys = tr $ filter (/= length xs) xs
tr zs = if null zs || last zs > 0 then zs else tr $ init zs
succ ([], len) = ([1], len + 1)
succ (d : ds, len)
| d < len = (head (dropWhile (<= d) a002024_list \\ ds) : ds, len)
| otherwise = (0 : ds', len') where (ds', len') = succ (ds, len)
-- Reinhard Zumkeller, Jul 04 2012
CROSSREFS
KEYWORD
easy,fini,nonn,base,nice
AUTHOR
STATUS
approved