A350369 a(n) is the length of the longest sequence of consecutive tripling steps in the Collatz (3x+1) sequence beginning at n.
0, 0, 2, 0, 1, 2, 3, 0, 3, 1, 2, 2, 1, 3, 4, 0, 1, 3, 2, 1, 1, 2, 3, 2, 2, 1, 6, 3, 2, 4, 6, 0, 2, 1, 2, 3, 3, 2, 3, 1, 6, 1, 3, 2, 1, 3, 6, 2, 3, 2, 2, 1, 1, 6, 6, 3, 3, 2, 2, 4, 3, 6, 6, 0, 3, 2, 2, 1, 1, 2, 6, 3, 6, 3, 2, 2, 2, 3, 4, 1, 3, 6, 6, 1, 1, 3, 3
Offset: 1
Examples
The Collatz sequence for n=7 has a streak of 3 consecutive tripling steps (at 7, 11, and 17), so a(7) = 3. 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 ^ ^ ^
Links
Programs
-
PARI
a(n)=my(c,r); n>>=valuation(n,2); while(n>1, n+=(n+1)/2; if(n%2, c++, r=max(r,c+1); n>>=valuation(n,2); c=0)); max(r,c) \\ Charles R Greathouse IV, Oct 25 2022
Comments