login
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
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,1
COMMENTS
In case of ties (two or more longest runs of same length), the highest starting value is picked. The first n for which the longest run of halving steps occurs at two different subtrajectories is 37, where the Collatz map contains the 4-step subtrajectories 112 -> 56 -> 28 -> 14 > 7 and 16 -> 8 -> 4 -> 2 -> 1. a(37) is therefore 112 (highest starting value).
If the Collatz conjecture (i.e., all trajectories reach 1) is true then, except for n = 2, 4 and 8, a(n) mod 16 = 0, since all trajectories contain (at least) 4 consecutive halvings.
FORMULA
a(2^k) = 2^k, for integers k >= 1.
a(n) mod 2^A347409(n) = 0.
EXAMPLE
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.
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}]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo Xausa, Sep 24 2021
STATUS
approved