A348007 Starting value of the longest run of halving steps in the trajectory from n to 1 in the Collatz map (or 3x+1 problem), or -1 if no such trajectory exists.
2, 16, 4, 16, 16, 16, 8, 16, 16, 16, 16, 16, 16, 160, 16, 16, 16, 16, 16, 64, 16, 160, 16, 16, 16, 160, 16, 16, 160, 160, 32, 16, 16, 160, 16, 112, 16, 304, 16, 160, 64, 112, 16, 16, 160, 160, 48, 112, 16, 16, 16, 160, 160, 160, 16, 112, 16, 304, 160, 160, 160
Offset: 2
Keywords
Examples
a(2) = 2 because the Collatz trajectory from 2 to 1 is simply 2 -> 1 (one halving step, starting at 2). a(3) = 16 because the trajectory from 3 to 1 is 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. Here, the longest halving run is the 4-step subtrajectory 16 -> 8 -> 4 -> 2 -> 1, which starts at 16. a(15) = 160 because the longest halving run in the trajectory from 15 to 1 (the 5-step subtrajectory 160 -> 80 -> 40 -> 20 -> 10 -> 5) starts at 160.
Programs
-
Mathematica
nterms=100;Table[c=n;cm=sm=0;While[c>1,If[OddQ[c],c=3c+1,s=IntegerExponent[c,2];If[s>sm,sm=s;cm=c,If[s==sm,cm=Max[cm,c]]];c/=2^s]];cm,{n,2,nterms+1}]
-
PARI
A348007(n) = { my(m2v=valuation(n,2), mx=n, t); while(n>1, if((t=valuation(n,2))>m2v, m2v=t; mx=n, if(t==m2v && n>mx, mx=n)); if(!(n%2),n/=2,n+=(n+n+1))); (mx); }; \\ Antti Karttunen, Oct 13 2021
Formula
a(2^k) = 2^k, for integers k >= 1.
a(n) mod 2^A347409(n) = 0.
Comments