cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A352895 #11 Apr 09 2022 13:25:30
%S A352895 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,
%T A352895 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,
%U A352895 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
%N 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.
%H A352895 Antti Karttunen, <a href="/A352895/b352895.txt">Table of n, a(n) for n = 1..65537</a>
%H A352895 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F A352895 a(n) = A333860(A006370(n)) = A333860(A014682(n)) = A333860(A139391(n)).
%e A352895 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.
%o A352895 (PARI)
%o A352895 A139391(n) = my(x = if(n%2, 3*n+1, n/2)); x/2^valuation(x, 2); \\ From A139391
%o A352895 A352895(n) = { my(mw=1); while(n>1, n = A139391(n); mw = max(hammingweight(n),mw)); (mw); };
%Y A352895 Cf. A000120, A006370, A014682, A139391, A333860, A352896.
%K A352895 nonn
%O A352895 1,3
%A A352895 _Antti Karttunen_, Apr 08 2022