OFFSET
1,1
COMMENTS
Let f(2n+1) = A000265(3n+2) be defined as in A159885. Then a(n) is the least number k of iterations such that either f^k(2n+1) < 2n+1 or A000120(f^k(2n+1)) < A000120(2n+1).
Using induction, one can prove that the Collatz (3x+1)-conjecture follows from the finiteness of a(n) for every n. - Vladimir Shevelev, May 05 2009
LINKS
MAPLE
A000265 := proc(n) option remember ; local a; a := n ; while a mod 2 = 0 do a := a/2 ; end do; a; end proc:
f := proc(n) local m ; m := (n-1)/2 ; A000265(3*m+2) ; end:
A000120 := proc(n) local d; add(d, d=convert(n, base, 2)) ; end proc:
A159885 := proc(n) local k, twon1; k := 0 ; twon1 := 2*n+1 ; while ( A000120(twon1) > A000120(n) ) do twon1 := f(twon1) ; k := k+1 ; end do; k ; end proc:
A122458 := proc(n) local tx1, a; a := 0 ; tx1 := 2*n+1 ; while tx1 >= 2*n+1 do if tx1 mod 2 = 0 then tx1 := tx1/2 ; else tx1 := 3*tx1+1 ; a := a+1 ; fi; end do; a ; end proc:
A160198 := proc(n) min(A159885(n), A122458(n)) ; end: seq(A160198(n), n=1..130) ; # R. J. Mathar, May 15 2009
MATHEMATICA
a[n_] := Module[{u=2n+1, w, k=0}, w = DigitCount[u, 2, 1]; While[u >= 2n+1 && DigitCount[u, 2, 1] >= w, k++; u = (3(u-1)/2+2)/2^IntegerExponent[ (3(u-1)/2+2), 2]]; k];
Array[a, 105] (* Jean-François Alcover, Apr 16 2020, after Antti Karttunen *)
PROG
(PARI)
A006519(n) = (1<<valuation(n, 2));
A160198(n) = { my(u = (n+n+1), w = hammingweight(u), k=0); while((u >= (n+n+1))&&(hammingweight(u) >= w), k++; u = f(u)); (k); }; \\ Antti Karttunen, Sep 22 2018
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Vladimir Shevelev, May 04 2009
EXTENSIONS
a(1) corrected and sequence extended by R. J. Mathar, May 15 2009
STATUS
approved