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 A173447 #17 Sep 08 2022 08:45:50 %S A173447 1,0,0,15,7,9,14,31,35,34,1,1,16,32,12,9,14,31,35,34,16,16,8,36,6,11, %T A173447 5,7,32,30,32,32,36,17,33,30,47,38,23,7,12,12,6,33,29,53,41,38,28,51, %U A173447 9,9,11,30,53,9,23,20,40,23,14 %N A173447 The number of iterations for the map r -> A061602(r), starting with n, needed to reach the end of the first cycle. %C A173447 The sequence counts the iterations needed to reach a cycle (or loop) of numbers. %C A173447 The reference (below) proves that the sequence of this numbers is finite and complete. %C A173447 For n=1, the cycle is (1, 1, 1, ...). For each integer n > 1, the iterations enter one of the following 6 loops: %C A173447 2, 2, 2, ... %C A173447 145, 145, 145, ... %C A173447 169, 363601, 1454, 169, ... %C A173447 871, 45361, 871, ... %C A173447 872, 45362, 872, ... %C A173447 40585, 40585, 40585, ... %C A173447 The set of numbers occurring in the 7 loops is {1, 2, 145, 169, 871, 872, 1454, 40585, 45361, 45362, 363601}. %D A173447 Jean-Marie De Koninck, Armel Mercier, 1001 problemes en theorie classique des nombres - Entry 258, p. 41. Ellipses, 2004. %e A173447 a(0) = 1 because 0 -> 1; %e A173447 a(1) = 0 because 1 -> 1; %e A173447 a(2) = 0 because 2 -> 2; %e A173447 a(4) = 7 because 4 -> 24 -> 26 -> 722 -> 5044 -> 169 -> 363601 -> 1454, with 7 iterations because 1454 -> 169; %e A173447 a(40585) = 0 because 40585 -> 40585. %p A173447 A061602 := proc(n) if n = 0 then 1; else add(d!,d=convert(n,base,10)) ; end if; end proc: %p A173447 A173447 := proc(n) trck := [n] ; while true do m := A061602(op(-1,trck)) ; if m in trck then return nops(trck)-1 ; else trck := [op(trck),m] ; end if; end do: end proc: %p A173447 seq(A173447(n),n=0..50) ; %o A173447 (Magma) a061602:=func< n | n eq 0 select 1 else &+[ Factorial(d): d in Intseq(n) ] >; %o A173447 a173447:=function(n); T:=[]; count:=0; a:=n; while a notin T do Append(~T, a); a:=a061602(a); count+:=1; end while; return count-1; end function; [ a173447(n): n in [0..60] ]; %Y A173447 Cf. A061602. %K A173447 nonn,base %O A173447 0,4 %A A173447 _Michel Lagneau_, Nov 22 2010 %E A173447 Reduced to three lines of numbers; rephrased in terms of A061602; replaced program by a structured version - _R. J. Mathar_, Nov 23 2010 %E A173447 Terms, offset, and example corrected by _D. S. McNeil_, Nov 23 2010