### A 3-branched generalized-Collatz Conjecture

Consider the function T1:

 T1(x) = 2x if 3 divides x, T1(x) = (7x+2)/3 if 3 divides x-1, T1(x) = (x-2)/3 if 3 divides x+1.

Clearly T1(x) ≥ 0 if x ≥ 1 and T1(x) < 0 if x < 0.
It is conjectured by Keith Matthews that
• every trajectory starting from x ≥ 1 will eventually enter the zero residue class (mod 3);
• every trajectory starting from x ≤ -1 will eventually enter the zero residue class (mod 3), or reach one of the cycles -1,-1 or -2,-4,-2.

Similarly, for the function

 T2(x) = 2x if 3 divides x, T2(x) = (5x-2)/3 if 3 divides x-1, T2(x) = (x-2)/3 if 3 divides x+1,

we conjecture that
• every trajectory starting from x ≥ 1 will eventually enter the zero residue class (mod 3), or reach the cycle 1,1;
• every trajectory starting from x ≤ -1 will eventually enter the zero residue class (mod 3), or reach one of the cycles -1,-1 or -2,-4,-2.
(See article on generalized 3x+1 mappings.)

A \$100 Australian prize for a resolution of one of these conjectures is offered.

The algorithms are performed with starting values y= 3M+1 and y=3M-1.

The iterates y, Ti(y), Ti(Ti(y)),... of each function are printed and the number of steps taken to reach either a multiple of 3, or else one of the cycles, is recorded.

Enter M:

Mapping T1
Mapping T2