A225089 a(n) = floor(2^A006666(m)/3^A006667(m)) - m, where m = 2n + 1.
0, 0, 0, 0, 0, 1, 1, 0, 2, 0, 1, 2, 1, 2, 1, 0, 1, 4, 3, 1, 0, 3, 2, 4, 4, 2, 5, 5, 4, 3, 5, 0, 6, 3, 2, 8, 7, 6, 8, 2, 7, 0, 10, 6, 5, 4, 7, 8, 10, 9, 8, 4, 3, 10, 9, 11, 14, 9, 12, 7, 6, 10, 9, 0, 14, 13, 12, 7, 6, 5, 10, 17, 13, 15, 0, 13, 12, 16, 15, 5, 8
Offset: 1
Keywords
Examples
a(9) = 3 because floor(2^A006666(19)/3^A006667(19)) - 19 = floor(2^14 /3^6) - 19 = floor(22.474622) - 19 = 22 - 19 = 3.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A:= proc(n) if type(n, 'even') then n/2; else 3*n+1 ; end if; end proc: B:= proc(n) a := 0 ; x := n ; while x > 1 do x := A(x) ; a := a+1 ; end do; a ; end proc: C:= proc(n) a := 0 ; x := n ; while x > 1 do if type(x, 'even') then x := x/2 ; else x := 3*x+1 ; a := a+1 ; end if; end do; a ; end proc: D:= proc(n) C(n) ; end proc: A006666:= proc(n) B(n)- C(n) ; end: A006667:= proc(n) C(n)- D(n) ; end: G:= proc(n) floor(2^A006666 (n)/3^A006667 (n)) ; end: for i from 1 to 100 do: printf(`%d, `, G(i)-i):od:
-
Mathematica
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 100; t = {}; n = 0; While[Length[t] < nn, n++; c = Collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; AppendTo[t, Floor[2^ev/3^od]-n]]; t
Comments