OFFSET
1,1
COMMENTS
Equivalently, a(n) is the number of iterations that n requires to reach -1 under the map x -> -x/2 if x is even, 3x - 1 if x is odd. This is called the shadow Collatz map in the Ryosuke Miyazawa reference.
Conjecture: Every nonzero integer reaches 1. Verified numerically up to +-5*10^7.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10001
Ryosuke Miyazawa, The Shadow Collatz Conjecture: The Journey of All Integers Toward -1, preprint, Zenodo, (2025).
FORMULA
a(1) = 2; for n > 1, a(n) = 1 + a(f(n)), where f(n) = -n/2 if n is even, 3n - 1 if n is odd.
EXAMPLE
n = 7 requires a(7) = 13 steps to reach -1: 7 -> 20 -> -10 -> 5 -> 14 -> -7 -> -22 -> 11 -> 32 -> -16 -> 8 -> -4 -> 2 -> -1.
MAPLE
a:= proc(n) option remember; `if`(n=-1, 0,
1+a(`if`(n::even, -n/2, 3*n-1)))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Aug 13 2025
MATHEMATICA
a[n_]:=Module[{s = 0, m = n}, While[m!=-1, s++; m=If[BitAnd[m, 1]==1, 3*m -1, -m/2]]; s]; Array[a, 70] (* James C. McMahon, Aug 18 2025 *)
PROG
(PARI) a(n) = if(n==0, oo, my(s=0); while(n!=-1, s++; n=if(bitand(n, 1), 3*n-1, -n/2)); s) \\ Andrew Howroyd, Aug 06 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Ryosuke Miyazawa, Aug 06 2025
STATUS
approved
