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 A009101 #42 Jan 09 2023 08:42:02 %S A009101 0,102,102,102,102,10,102,102,102,102,10,102,102,102,102,20,102,102, %T A009101 102,60,20,110,102,110,102,50,102,140,60,110,30,70,102,50,70,50,102, %U A009101 170,102,102,40,140,50,80,60,140,70,110,80,150,50,170,102,202,102,80,170,110,170 %N A009101 Fixed point when iterating the function f on n, where f(x) = x + product of digits of x. %C A009101 Starting at n and iterating f, a(n) is the first number reached that contains the digit zero. %C A009101 Record values of the number of steps to obtain a(n) are 10 for n = 1, 27 for n = 187, 28 for n = 3237326, 32 for n = 3515987, 33 for n = 22572473. It is conjectured that a(n) is obtained in a finite number of steps for every n. %C A009101 Comment from Adam Kabela, Nov 19 2013: (Start) %C A009101 The number of steps is finite for every n. The idea is for large k, 9^k < 10^(k-1). The x+f(x) is not increasing fast enough. At some point for high k, in one step the first digit is increased by at most 1. But 9+1= 10. Hence a zero appears sooner or later for every starting x. (The idea is mentioned for example in the XKCD Forum, see link below.) The argument holds not just in base 10 but in other bases too. (End) %C A009101 Comment from _N. J. A. Sloane_, Nov 19 2013: (Start) %C A009101 The XKCD Forum mentioned by Kabela says "If it is unbounded, then there is a first element in the sequence above 10^n for any n. The previous number had n digits, so the digit product that was added to get above 10^n is at most 9^n. Therefore the current number is at most 10^n+9^n. For n>21, this number begins with the digits "10", so from then on the product of the digits is zero and the sequence no longer increases." (End) %H A009101 Alois P. Heinz, <a href="/A009101/b009101.txt">Table of n, a(n) for n = 0..30000</a> (first 1001 terms from Vincenzo Librandi) %H A009101 XKCD Forum, <a href="http://forums.xkcd.com/viewtopic.php?f=3&t=101919">"Projectors" and other Math Puzzles by Vlad Mitlin</a> %H A009101 <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a> %e A009101 f(5) = 10, f(10) = 10, hence a(5) = 10. %e A009101 f(19) = 28, f(28) = 44, f(44) = 60, f(60) = 60, hence a(19) = 60. %p A009101 a:= n-> (m-> `if`(m=0, n, a(n+m)))(mul(i, i=convert(n, base, 10))): %p A009101 seq(a(n), n=0..58); # _Alois P. Heinz_, Jun 21 2022 %t A009101 Table[FixedPoint[#+Times@@IntegerDigits[#]&,n],{n,0,60}] (* _Harvey P. Dale_, Oct 11 2012 *) %o A009101 (Python) %o A009101 from math import prod %o A009101 def f(x): return x + prod(map(int, str(x))) %o A009101 def a(n): %o A009101 x, fx = n, f(n) %o A009101 while x != fx: x, fx = fx, f(fx) %o A009101 return x %o A009101 print([a(n) for n in range(60)]) # _Michael S. Branicky_, Jun 21 2022 %Y A009101 Cf. A007954 (product of digits of n), A230099. %K A009101 nonn,base %O A009101 0,2 %A A009101 _David W. Wilson_ %E A009101 Additional comments from _Klaus Brockhaus_, Mar 12 2006 %E A009101 Edited by _N. J. A. Sloane_, Aug 19 2008 at the suggestion of _R. J. Mathar_