login
A246425
In the Collatz 3x+1 problem: start at an odd number 2n+1 and find the next odd number 2m+1 in the trajectory; then a(n) = m-n.
2
0, 1, -2, 2, -1, 3, -4, 4, -2, 5, -10, 6, -3, 7, -9, 8, -4, 9, -15, 10, -5, 11, -14, 12, -6, 13, -24, 14, -7, 15, -19, 16, -8, 17, -28, 18, -9, 19, -24, 20, -10, 21, -42, 22, -11, 23, -29, 24, -12, 25, -41, 26, -13, 27, -34, 28, -14, 29, -53, 30, -15, 31, -39, 32, -16, 33, -54, 34, -17, 35, -44, 36, -18, 37, -71, 38, -19, 39, -49, 40, -20, 41, -67, 42, -21, 43, -54, 44, -22, 45, -82, 46, -23, 47, -59, 48, -24, 49, -80, 50
OFFSET
0,3
COMMENTS
Positive terms indicate the next odd number 2m+1 in the trajectory is greater than 2n+1 which is the case every second time giving a(n) = m-n = (n+1)/2.
Negative terms indicate the next odd number 2m+1 in the trajectory is smaller than 2n+1. For behavior of this part refer to A087230.
FORMULA
a(n) = ((6*n+4)/2^A087230(n) - (2*n+1))/2.
EXAMPLE
a(14)=-9 because 2*14 + 1 = 29 and the Collatz trajectory to reach the next odd number goes: 29, 88, 44, 22, 11. Thus, m=5 and 5 - 14 = -9.
MAPLE
f:= proc(n) local m;
m:= 6*n+4;
m/2^(1+padic:-ordp(m, 2))-n-1/2
end proc:
map(f, [$0..100]); # Robert Israel, Mar 22 2020
MATHEMATICA
a[n_] := ((6n+4)/2^IntegerExponent[6n+4, 2] - (2n+1))/2;
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 15 2023 *)
PROG
(PARI) forstep(n=0, 1000, 1, m=6*n+4; print1(((m/2^valuation(m, 2)-(2*n+1))/2), ", "))
CROSSREFS
KEYWORD
sign,nice,look
AUTHOR
K. G. Stier, Aug 26 2014
STATUS
approved