OFFSET
0,4
COMMENTS
The sequence counts the iterations needed to reach a cycle (or loop) of numbers.
The reference (below) proves that the sequence of this numbers is finite and complete.
For n=1, the cycle is (1, 1, 1, ...). For each integer n > 1, the iterations enter one of the following 6 loops:
2, 2, 2, ...
145, 145, 145, ...
169, 363601, 1454, 169, ...
871, 45361, 871, ...
872, 45362, 872, ...
40585, 40585, 40585, ...
The set of numbers occurring in the 7 loops is {1, 2, 145, 169, 871, 872, 1454, 40585, 45361, 45362, 363601}.
REFERENCES
Jean-Marie De Koninck, Armel Mercier, 1001 problemes en theorie classique des nombres - Entry 258, p. 41. Ellipses, 2004.
EXAMPLE
a(0) = 1 because 0 -> 1;
a(1) = 0 because 1 -> 1;
a(2) = 0 because 2 -> 2;
a(4) = 7 because 4 -> 24 -> 26 -> 722 -> 5044 -> 169 -> 363601 -> 1454, with 7 iterations because 1454 -> 169;
a(40585) = 0 because 40585 -> 40585.
MAPLE
PROG
(Magma) a061602:=func< n | n eq 0 select 1 else &+[ Factorial(d): d in Intseq(n) ] >;
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] ];
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Nov 22 2010
EXTENSIONS
Reduced to three lines of numbers; rephrased in terms of A061602; replaced program by a structured version - R. J. Mathar, Nov 23 2010
Terms, offset, and example corrected by D. S. McNeil, Nov 23 2010
STATUS
approved