### Mapping P4

In an email dated April 1, 2021, Brian Gurbaxani (briangurbaxani@gmail.com) sent me the following varation of the 3x+1 mapping:

If n is even, T(n) = n/2; if n is odd and divisible by 5, then T(n) = (m*n/5 + 1)/2, otherwise T(n) = (3n + 1)/2, for some fixed odd integer m ≥ 3.

This is very similar to the 3x+1 mapping unless n is odd and divisible by 5, and if we set the parameter m = 15, it is exactly the 3x+1 mapping.
He conjectured that the iterative sequence x, T(x), T(T(x)),... is always bound to converge to one of a finite number of finite cycles for all m ≤ 73 (later changed to m < 73).

Mapping P4 can be regarded as a d-branched generalized 3x+1 mapping T: ℤ → ℤ, where T(x) = int(mix/d) + Xi, if x ≡ i (mod d), where d = 10,
m0 = 5, m1 = 15, m2 = 5, m3 = 15, m4 = 5, m5 = m, m6 = 5, m7 = 15, m8 = 5, m9 = 15 and

X0 = 0, X1 = 1, X2 = 0, X3 = 1, X4 = 0, X5 = 1, X6 = 0, X7 = 1, X8 = 0, X9 = 1:

 T(x) = x/2 if x ≡ 0 (mod 10) T(x) = (3x + 1)/2 if x ≡ 1 (mod 10) T(x) = x/2 if x ≡ 2 (mod 10) T(x) = (3x + 1)/2 if x ≡ 3 (mod 10) T(x) = x/2 if x ≡ 4 (mod 10) T(x) = (mx + 5)/10 if x ≡ 5 (mod 10) T(x) = x/2 if x ≡ 6 (mod 10) T(x) = (3x + 1)/2 if x ≡ 7 (mod 10) T(x) = x/2 if x ≡ 8 (mod 10) T(x) = (3x + 1)/2 if x ≡ 9 (mod 10)

This mapping is of type (b) where type (b) means gcd(mi, d2) = gcd(mi, d) for 0 ≤ i ≤ d - 1.

Then conjecturally, we get everywhere cycling if and only if the weighted product P = Π0 ≤ i ≤ d-1(mi/d)pi < 1, where (p0, ..., pd-1) is the stationary vector of the Markov matrix Q(d), which is defined in that paper.

It seems certain that the 10×10 Markov matrix Q(10) is independent of m, but I haven't the patience to prove this.

We calculate Q(10) for m = 73, using the BCMath program Generalized 3x+1 functions and Markov matrices. This matrix has stationary vector (1/110)(10,14,13,8,10,10,14,13,8,10) and the weighted product P satisfies

P = (1/2)10 (3/2)14 (1/2)13 (3/2)8 (1/2)10 (m/10)10 (1/2)14 (3/2)13 (1/2)8 (3/2)10 < 1

if and only if m < 5(211)/3(9/2) = 72.988...,

So we expect everywhere cycling if and only if m < 73.

The case m = 73 is interesting. We expect to find trajectories n0, T(n0), T(T(n0)),...that appear to be divergent. One such example is n0 = 100545. David Bařina has followed this trajectory for 20,400,000,000 iterations reaching an iterate of 144,284 digits.

Conjecturally, (Tk(n0))1/k → P = 1.0000143... (graph supplied by Brian Gurbaxani)

It can take many iterations to reach a cycle. For example,
• n0 = 105000 + 1 took 849,740,625 iterations to reach 1,
• n0 = -10500 + 1 took 65,501,346 iterations to reach -1,
• n0 = 33145 took 1,400,642,131 iterations to reach 71.

My CALC cycle program finds 18 cycles with starting points (and lengths):

0 (1), -1 (1), 1 (2), 5 (11), -5 (9), -17 (6), 71 (58), -1265 (5470), -1237 (43), -4337 (21), -3257 (21), -4129 (21), 505 (807), -1375 (21), -1055 (21), -1385 (21), -4313 (21), -4157 (1923).

### Mapping P2

Here we are dealing with a 6-branched mapping:
``` T(x) = x/2        if x = 0 (mod 6)
T(x) = (5x+1)/2   if x = 1 (mod 6)
T(x) = x/2        if x = 2 (mod 6)
T(x) = (7x/3+1)/2 if x = 3 (mod 6)
T(x) = x/2        if x = 4 (mod 6)
T(x) = (5x+1)/2   if x = 5 (mod 6).

```
In terms of the integer part symbol:

T(x) = int(mix/6)+Xi, if x ≡ i (mod 6), i = 0,...,5, and where

m0 = 3, m1 = 15, m2 = 3, m3 = 7, m4 = 3, m5 = 15,

X0 = 0, X1 = 1, X2 = 0, X3 = 1, X4 = 0, X5 = 1.

The Markov matrix approach can be used, as gcd(mi, d2) = gcd(mi, d) for all i, with d = 6.

We calculate the Markov matrix Q(6) using the BCMath program Generalized 3x+1 functions and Markov matrices. This has stationary vector (6/26, 4/26, 3/26, 6/26, 4/26, 3/26) = (p0,p1,p2,p3,p4,p5) for brevity.

The weighted product is

P = (3/6)(6/26)(15/6)(4/26)(3/6)(3/26)(7/6)(6/26)(3/6)(4/26)(15/6)(3/26)
= 5776/(22636) = 0.1878... <1.

Hence we expect all trajectories to eventually cycle.

My CALC cycle program finds 13 cycles with starting points (and lengths): 0 (1), -1 (2), 1 (4), -3 (1), 21 (309), 7 (6), -63 (20), -41 (20), 141 (6), 85 (6), 121 (6), 1303 (33), 69721 (44), and I am certain that all trajectories will eventually enter one of these cycles.

Enter x: