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.
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
Examples
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.
Links
- Ruud H.G. van Tol, Table of n, a(n) for n = 0..20000
- Ruud H.G. van Tol, Perl program
- Index entries for sequences related to 3x+1 (or Collatz) problem
Programs
-
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 *)
-
PARI
forstep(n=0, 1000, 1, m=6*n+4; print1(((m/2^valuation(m, 2)-(2*n+1))/2),", "))
Formula
a(n) = ((6*n+4)/2^A087230(n) - (2*n+1))/2.
Comments