OFFSET
0,9
COMMENTS
A060130(n) gives the number of steps needed to reach zero, when starting iterating as a(k), a(a(k)), etc., from the starting value k = n.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10080
FORMULA
a(n) = n - A257686(n).
EXAMPLE
Factorial base representation (A007623) of 1 is "1", discarding the most significant digit leaves nothing, taken to be zero, thus a(1) = 0.
Factorial base representation of 2 is "10", discarding the most significant digit leaves "0", thus a(2) = 0.
Factorial base representation of 3 is "11", discarding the most significant digit leaves "1", thus a(3) = 1.
Factorial base representation of 4 is "20", discarding the most significant digit leaves "0", thus a(4) = 0.
MATHEMATICA
f[n_] := Block[{m = p = 1}, While[p*(m + 1) <= n, p = p*m; m++]; Mod[n, p]]; Array[f, 101, 0] (* Robert G. Wilson v, Jul 21 2015 *)
PROG
(Python)
from sympy import factorial as f
def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
def a(n):
x=str(a007623(n))[1:][::-1]
return sum(int(x[i])*f(i + 1) for i in range(len(x)))
print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 21 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, May 04 2015
STATUS
approved