This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A038528 #17 Aug 08 2024 06:38:03 %S A038528 1,12,20,21,22,123,132,133,203,213,223,230,231,232,300,301,303,312, %T A038528 313,320,321,322,330,331,333,1234,1243,1244,1324,1334,1342,1343,1423, %U A038528 1424,1432,1433,1442,1444,2034,2043,2044,2134,2143,2144,2234 %N A038528 If n has decimal expansion abc...d, with k digits, let f(n) be obtained by deleting all k's from abc...d, closing up and deleting initial 0's; sequence gives n such that f(f(f(...(n)))) = 0 or empty. %C A038528 The sequence has exactly 14174521 terms, 999999999 is the last and largest. - _Reinhard Zumkeller_, Jul 04 2012 %H A038528 Reinhard Zumkeller, <a href="/A038528/b038528.txt">Table of n, a(n) for n = 1..10000</a> %F A038528 A054055(a(n)) = A055642(a(n)). - _Reinhard Zumkeller_, Jul 04 2012 %e A038528 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. %e A038528 The last 12 terms are: 999999333, 999999900, 999999901, 999999909, 999999912, 999999919, 999999920, 999999921, 999999922, 999999990, 999999991, 999999999. %t A038528 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 *) %o A038528 (Haskell) %o A038528 import Data.List ((\\)) %o A038528 a038528 n = a038528_list !! (n-1) %o A038528 a038528_list = gen ([1], 1) where %o A038528 gen (_, 10) = [] %o A038528 gen (ds, len) %o A038528 | len `elem` ds && chi ds %o A038528 = foldr (\u v -> u + 10*v) 0 ds : gen (succ (ds, len)) %o A038528 | otherwise = gen (succ (ds, len)) %o A038528 chi xs = null ys || ys /= xs && chi ys where %o A038528 ys = tr $ filter (/= length xs) xs %o A038528 tr zs = if null zs || last zs > 0 then zs else tr $ init zs %o A038528 succ ([], len) = ([1], len + 1) %o A038528 succ (d : ds, len) %o A038528 | d < len = (head (dropWhile (<= d) a002024_list \\ ds) : ds, len) %o A038528 | otherwise = (0 : ds', len') where (ds', len') = succ (ds, len) %o A038528 -- _Reinhard Zumkeller_, Jul 04 2012 %Y A038528 Cf. A038527. %Y A038528 Cf. A002024, A055642, A031298, subsequence of A138166. %K A038528 easy,fini,nonn,base,nice %O A038528 1,2 %A A038528 _Naohiro Nomoto_