%I
%S 0,2,3,6,5,7,4,17,8,31,10,76,24,8,5,35,28,17,16,11,27,13,22,44,72,54,
%T 90,15,16,38,6,35,39,113,86,99,92,33,53,63,13,54,170,79,56,71,41,107,
%U 23,11,96,67,30,158,87,9,40,49,22,116,62,60,7,54,71,44,67
%N Collatz (3x+1) problem with rational numbers: number of steps to reach the end of the cycle starting with 1/(2n+1).
%C This variation of the "3x+1" problem with a class of rational numbers is as follows: start with any number 1/(2n+1). If the numerator is even, divide it by 2, otherwise multiply it by 3 and add 1. Do we always reach the end of a cycle with a rational number? It is conjectured that the answer is yes.
%C If x is of the form 1/2n, each trajectory is divergent because the numerator is always odd and tends into infinity.
%C If x is of the form x = m/(2n+1) where m is an integer, it is conjectured that the number of steps tends into the end of a finite cycle.
%C In this sequence, it appears that the last number of the cycle is 1 when 2n+1 is a power of 3. For example, starting with 1/9, the trajectory is 1/9 > 4/3 > 2/3 > 1/3 > 2 > 1 with 5 iterations.
%C Observations: the last number of each trajectory has three possible forms: 1, 2/(2n+1) or a form m/(2n+1) where m> 2.
%H Michel Lagneau, <a href="/A210468/b210468.txt">Table of n, a(n) for n = 0..10000</a>
%H J. C. Lagarias, <a href="http://pldml.icm.edu.pl:80/mathbwn/element/bwmeta1.element.bwnjournalarticleaav56i1p33bwm?q=bwmeta1.element.bwnjournalnumberaa1990561&qt=CHILDRENSTATELESS">The set of rational cycles for the 3x+1 problem,</a> Acta Arith. 56 (1990), 3353.
%e For n = 3, a(3) = 6 because the corresponding trajectory of 1/7 requires 6 iterations to reach the last term of the cycle:
%e 1/7 > 10/7 > 5/7 > 22/7 > 11/7 > 40/7 > 20/7 and 20/7 is the last term because 20/7 > 10/7 is already in the trajectory. The rational 10/7 has two antecedents: 1/7 and 20/7 are in the same trajectory (this property is conjecturally impossible in the classical 3x + 1 problem with x integer). The periodic nontrivial loop contains 6 distinct rational numbers (20/7 >10/7>5/7 >22/7 > 11/7 > 40/7).
%p with(numtheory): z:={1}:for m from 0 to 80 do: n:=2*m+1:lst:={1/n}:x0:=1: x:=x0*3+n: lst:=lst union {x/n}:for i from 1 to 10000 do: x:=x/2: lst:=lst union {x/n}: if irem(x,2)=1 then x0:=x:x:=x0*3+n: lst:=lst union {x/n}:else fi:od: n0:=nops(lst):if lst intersect z = {1} then n1:=n02: printf(`%d, `,n1): else n1:=n01: printf(`%d, `,n1):fi: od:
%t Collatz[n_] := NestWhileList[If[EvenQ[Numerator[#]], #/2, 3 # + 1] &, n, UnsameQ, All]; Join[{0}, Table[s = Collatz[1/(2 n + 1)]; len = Length[s]  2; If[s[[1]] == 2, len = len  1]; len, {n, 100}]] (* _T. D. Noe_, Jan 22 2013 *)
%Y Cf. A006577.
%K nonn,nice
%O 0,2
%A _Michel Lagneau_, Jan 22 2013
