A348192 a(0) = 0; for n >= 1, a(n) = 1 + a(n - GCD(n, digital sum(n))).
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 3, 4, 3, 4, 5, 2, 3, 3, 3, 4, 5, 3, 4, 4, 3, 5, 6, 4, 5, 6, 5, 6, 7, 4, 5, 6, 5, 5, 6, 5, 6, 6, 5, 7, 8, 5, 6, 6, 6, 7, 8, 6, 7, 8, 7, 8, 9, 7, 8, 8, 7, 9, 10, 8, 9, 9, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 11, 9, 9, 10, 11, 9, 10, 10, 10, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13
Offset: 0
Examples
n = 12, a(12) = 1 + a(12 - GCD(12,3)) = 1 + a(9) = 1 + 1 + a(9 - GCD(9,9)) = 2 + a(0) = 2.
Programs
-
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 *)
-
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] A348192_list = list(islice(A348192_gen(),30)) # Chai Wah Wu, Jan 26 2022
Formula
a(0) = 0; for n >= 1, a(n) = 1 + a(n - A066750(n)).
Comments