login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of steps to reach 0 starting with n and using the iterated process: x -> x - (sum of digits in factorial expansion of x).
15

%I #18 Jun 29 2016 00:20:44

%S 0,1,2,2,3,3,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,10,10,10,10,11,

%T 11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,14,14,15,15,15,15,16,16,

%U 16,16,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19

%N Number of steps to reach 0 starting with n and using the iterated process: x -> x - (sum of digits in factorial expansion of x).

%C See A007623 for the factorial number system representation.

%H A. Karttunen, <a href="/A219652/b219652.txt">Table of n, a(n) for n = 0..10080</a>

%F a(0)=0; for n>0, a(n) = 1 + a(A219651(n)).

%t nn = 72; m = 1; While[Factorial@ m < nn, m++]; m; Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, n, # > 0 &] - 1, {n, 0, nn}] (* _Michael De Vlieger_, Jun 27 2016, Version 10.2 *)

%o (Scheme with memoization macro definec): (definec (A219652 n) (if (zero? n) n (+ 1 (A219652 (A219651 n)))))

%Y Analogous sequence for binary system: A071542, for Zeckendorf expansion: A219642. Cf. A007623, A034968, A219650, A219651, A219653-A219655, A219659, A219661, A219666.

%K nonn,base

%O 0,3

%A _Antti Karttunen_, Nov 25 2012

%E Erroneous description corrected by _Antti Karttunen_, Dec 03 2012