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 A356515 #7 Aug 12 2022 12:37:31 %S A356515 0,1,1,2,1,2,2,1,1,2,2,1,2,1,1,2,1,2,2,1,2,1,1,2,2,1,1,2,1,2,2,3,1,2, %T A356515 2,1,2,1,1,2,2,1,1,2,1,2,2,3,2,1,1,2,1,2,2,3,1,2,2,3,2,3,3,2,1,2,2,1, %U A356515 2,1,1,2,2,1,1,2,1,2,2,3,2,1,1,2,1,2,2 %N A356515 For any n >= 0, let x_n(1) = n, and for any b > 1, x_n(b) is the sum of digits of x_n(b-1) in base b; x_n is eventually constant, with value a(n). %C A356515 This sequence is unbounded (see also A356516). %F A356515 a(2*n) = a(n). %e A356515 For n = 87: %e A356515 - we have: %e A356515 b x_87(b) x_87(b) in base b+1 %e A356515 --- ------- ------------------- %e A356515 1 87 "1010111" %e A356515 2 5 "12" %e A356515 >=3 3 "3" %e A356515 - so a(87) = 3. %o A356515 (PARI) a(n) = { for (b=2, oo, if (n<b, return (n), n=sumdigits(n,b))) } %o A356515 (Python) %o A356515 from sympy.ntheory import digits %o A356515 def a(n): %o A356515 xn, b = n, 2 %o A356515 while xn >= b: xn = sum(digits(xn, b)[1:]); b += 1 %o A356515 return xn %o A356515 print([a(n) for n in range(105)]) # _Michael S. Branicky_, Aug 10 2022 %Y A356515 Cf. A000120, A053735, A356384, A356516. %K A356515 nonn,base,easy %O A356515 0,4 %A A356515 _Rémy Sigrist_, Aug 09 2022