OFFSET
0,11
COMMENTS
Number of steps needed to reach zero when starting from k = n and repeatedly applying the map that replaces k by k - A066750(k).
FORMULA
a(0) = 0; for n >= 1, a(n) = 1 + a(n - A066750(n)).
EXAMPLE
n = 12, a(12) = 1 + a(12 - GCD(12,3)) = 1 + a(9) = 1 + 1 + a(9 - GCD(9,9)) = 2 + a(0) = 2.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = 1 + a[n - GCD[n, Plus @@ IntegerDigits[n]]]; Array[a, 100, 0] (* Amiram Eldar, Jan 25 2022 *)
PROG
(Python)
from itertools import count, islice
from math import gcd
def A348192_gen(): # generator of terms
blist = [0]
yield 0
for n in count(1):
blist.append(1+blist[n-gcd(n, sum(int(d) for d in str(n)))])
yield blist[-1]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Jan 25 2022
STATUS
approved