login
A322983
Number of iterations of A011371(x) = x - A000120(x) needed to reach an odd number, when starting from x = n.
3
0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 3, 0, 1, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 1, 0, 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0
OFFSET
1,6
COMMENTS
Terms 0 .. 10 occur for the first time at n = 1, 2, 6, 12, 126, 192, 486, 492, 498, 504, 65458.
FORMULA
If n is odd, a(n) = 0, if n is even, a(n) = 1 + a(A011371(n)).
PROG
(PARI) A322983(n) = if((n%2), 0, 1+A322983(n - hammingweight(n)));
CROSSREFS
Cf. also A322996.
Sequence in context: A230642 A053473 A345388 * A208459 A144764 A084929
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jan 05 2019
STATUS
approved