Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #24 Feb 09 2021 11:00:58
%S 0,1,3,2,6,4,4,3,11,7,7,5,9,5,5,4,12,12,12,8,8,8,8,6,10,10,10,6,14,6,
%T 6,5,21,13,13,13,13,13,13,9,17,9,9,9,17,9,9,7,19,11,11,11,11,11,11,7,
%U 15,15,15,7,15,7,7,6,22,22,22,14,14,14,14,14,22,14
%N a(n) is the number of iterations of A245471 needed to reach 1 starting from n.
%C This sequence is well defined.
%C Sketch of proof:
%C - we focus on odd numbers n > 1,
%C - if the binary representation of n ends with k 0's and one 1:
%C in two steps we obtain a number with the same binary length as n
%C and ending with k-1 0's and one 1,
%C iterating again will eventually give a number ending with two or more 1's,
%C - if the binary representation of n ends with k 1's (k > 1):
%C in k+1 steps we obtain a number with a binary length strictly smaller
%C than that of n,
%C - so any odd number > 1 will eventually reach the number 1.
%H Rémy Sigrist, <a href="/A340873/b340873.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F a(2*n) = a(n) + 1.
%e For n = 10:
%e - the trajectory of 10 is 10 -> 5 -> 14 -> 7 -> 8 -> 4 -> 2 -> 1,
%e - so a(10) = 7.
%o (PARI) a(n) = for (k=0, oo, if (n==1, return (k), n%2, n=bitxor(n, 2*n+1), n=n/2))
%Y Cf. A006577, A245471, A341194, A341218, A341220, A341231, A341235.
%K nonn,base
%O 1,3
%A _Rémy Sigrist_, Jan 31 2021