login
A352895
The maximum binary weight of those elements of the Collatz orbit of n that follow after the term n itself, when iterated down to 1, or -1 if 1 is never reached.
4
1, 1, 2, 1, 1, 2, 3, 1, 3, 2, 3, 2, 2, 3, 4, 1, 3, 3, 4, 2, 1, 3, 4, 2, 4, 3, 8, 3, 3, 4, 8, 1, 4, 3, 4, 3, 3, 4, 5, 2, 8, 3, 3, 3, 3, 4, 8, 2, 3, 4, 4, 3, 2, 8, 8, 3, 4, 4, 4, 4, 4, 8, 8, 1, 3, 4, 4, 3, 3, 4, 8, 3, 8, 3, 4, 4, 4, 5, 6, 2, 5, 8, 8, 3, 1, 4, 4, 3, 4, 4, 8, 4, 4, 8, 8, 2, 8, 3, 4, 4, 4, 4, 8, 3, 6
OFFSET
1,3
FORMULA
a(n) = A333860(A006370(n)) = A333860(A014682(n)) = A333860(A139391(n)).
EXAMPLE
Iterates of A006370 (down to 1) when starting from n = 29 are 29 -> 88 -> 44 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 4 -> 2 -> 1. Because A000120(2*n) = A000120(n), we can consider only the odd terms in the trajectory (iterates of A139391), and these are 29 -> 11 -> 17 -> 13 -> 5 -> 1. Their hamming weights are 4, 3, 2, 3, 2, 1. However, in this sequence (in contrast to A333860), we discard the binary weight of the starting value (which here is A000120(29)=4), and take the maximum of the rest, therefore a(29) = 3.
PROG
(PARI)
A139391(n) = my(x = if(n%2, 3*n+1, n/2)); x/2^valuation(x, 2); \\ From A139391
A352895(n) = { my(mw=1); while(n>1, n = A139391(n); mw = max(hammingweight(n), mw)); (mw); };
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 08 2022
STATUS
approved