login
A173447
The number of iterations for the map r -> A061602(r), starting with n, needed to reach the end of the first cycle.
3
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, 5, 7, 32, 30, 32, 32, 36, 17, 33, 30, 47, 38, 23, 7, 12, 12, 6, 33, 29, 53, 41, 38, 28, 51, 9, 9, 11, 30, 53, 9, 23, 20, 40, 23, 14
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
A061602 := proc(n) if n = 0 then 1; else add(d!, d=convert(n, base, 10)) ; end if; end proc:
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:
seq(A173447(n), n=0..50) ;
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
Cf. A061602.
Sequence in context: A263400 A240909 A133817 * A377612 A168211 A131876
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