A173447 The number of iterations for the map r -> A061602(r), starting with n, needed to reach the end of the first cycle.
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
Examples
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.
References
- Jean-Marie De Koninck, Armel Mercier, 1001 problemes en theorie classique des nombres - Entry 258, p. 41. Ellipses, 2004.
Crossrefs
Cf. A061602.
Programs
-
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] ];
-
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) ;
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
Comments