login
For n >= 1; x = n, then iterate x --> x + h(x) until h(x + h(x)) >= h(x). a(n) gives the number of iteration steps where h(i) is A000120(i).
0

%I #21 Oct 19 2021 10:58:03

%S 5,4,3,3,2,1,1,4,3,3,2,2,1,1,1,7,6,6,5,5,1,4,3,3,3,2,2,2,1,1,1,7,6,6,

%T 5,5,1,4,3,3,3,2,2,2,1,1,1,5,3,4,2,2,3,3,1,2,2,2,1,1,1,1,1,7,6,6,5,5,

%U 1,4,3,3,3,2,2,2,1,1,1,5,3,4,2,2,3,3,1,2,2,2,1,1,1,1,1,5,3,4,2,2,3,4,1,2,2,3,1,1,1,2

%N For n >= 1; x = n, then iterate x --> x + h(x) until h(x + h(x)) >= h(x). a(n) gives the number of iteration steps where h(i) is A000120(i).

%C a(n) = 1 for n such that A000120(n + A000120(n)) < A000120(n).

%e 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).

%t 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 *)

%Y Cf. A000120, A092391.

%K nonn,base

%O 1,1

%A _Ctibor O. Zizka_, Oct 13 2021