OFFSET
1,1
EXAMPLE
n = 19; x(1) = 19 + h(19) = 22, h(22) >= h(19) thus x(2) = 22 + h(22) = 25, h(25) >= h(22) thus x(3) = 25 + h(25) = 28, h(28) >= h(25) thus x(4) = 28 + h(28) = 31, h(31) >= h(28) thus x(5) = 31 + h(31) = 36, h(36) < h(31) thus stop. a(19) = 5. h(i) is A000120(i).
MATHEMATICA
h[n_] := DigitCount[n, 2, 1]; x[n_] := n + h[n]; a[n_] := Length@ NestWhileList[x, n, h[#] <= h[x[#]] &]; Array[a, 110] (* Amiram Eldar, Oct 15 2021 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Oct 13 2021
STATUS
approved