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 A349250 #18 Dec 04 2021 12:42:17 %S A349250 8,7,5,10,12,14,16,18,20,22,6,5,3,8,10,12,14,16,18,20,4,2,6,8,10,12, %T A349250 14,16,18,20,6,8,8,12,10,12,14,16,18,20,10,10,10,10,12,12,14,16,18,20, %U A349250 12,12,12,12,12,16,14,16,18,20,14,14,14,14,14,14,14,16,18,20 %N A349250 Size of the orbit of n under iterations of the digit-census function A348783. %C A349250 Equivalently: the number of times the function A348783 must be iterated, starting with n, before a value occurs for the second time. %C A349250 It can be shown that the trajectory of all numbers end in one of the two limit cycles (21, 110) or (22, 200, 102, 111, 30, 1001). Therefore a(n) >= 2 with equality iff n = 21 or n = 110. %e A349250 Under iterations of A348783, 0 -> 1 -> 10 -> 11 -> 20 -> 101 -> 21 -> 110 -> 21 -> ...: here, the cycle (21, 110) is reached, so the orbit of 0 is O(0) = {0, 1, 10, 11, 20, 101, 21, 110}, of size a(0) = 8. We may also deduce that a(1) = 7, a(10) = 6, a(11) = 5, a(20) = 4, a(101) = 3 and a(21) = a(110) = 2 which is the length of the cycle these elements belong to. %e A349250 Similarly, 2 -> 100 -> 12 -> 110 -> 21 -> ..., so the orbit of 2 is O(2) = {2, 100, 12, 110, 21}, of size a(2) = 5. We also deduce a(100) = 4 and a(12) = 3. %e A349250 Then, 3 -> 1000 -> 13 -> 1010 -> 22 -> 200 -> 102 -> 111 -> 30 -> 1001 -> 22 -> 200 -> ..., here the cycle (22, 200, 102, 111, 30, 1001) is reached, and we have the orbit O(3) = {3, 1000, 13, 1010, 22, 200, 102, 111, 30, 1001}, of size a(3) = 10, and also a(1000) = 9, a(13) = 8, a(1010) = 7 and a(n) = 6 for the elements of that cycle. %t A349250 Array[-1 + Length@ NestWhileList[FromDigits@ RotateLeft@ Reverse@ DigitCount[#] &, #, UnsameQ[##] &, All] &, 60, 0] (* _Michael De Vlieger_, Nov 23 2021 *) %o A349250 (PARI) apply( {A349250(n,S=[n])=while(!setsearch(S,n=A348783(n)),S=setunion(S,[n]));#S}, [0..99]) %o A349250 (Python) %o A349250 def f(n): %o A349250 s = str(n) %o A349250 return int("".join(str(s.count(d)) for d in "9876543210").lstrip("0")) %o A349250 def a(n): %o A349250 orbit, fn = {n}, f(n) %o A349250 while fn not in orbit: %o A349250 orbit.add(fn) %o A349250 n, fn = fn, f(fn) %o A349250 return len(orbit) %o A349250 print([a(n) for n in range(70)]) # _Michael S. Branicky_, Nov 18 2021 %Y A349250 Cf. A348783 ("digit census function"), A349249 (number of iterations to reach a limiting cycle). %K A349250 nonn,base %O A349250 0,1 %A A349250 _M. F. Hasler_, Nov 17 2021