The 4n-1 Modification

  1. Introduction
  2. Larger View of the Tree
  3. Searching for Loops

Introduction

We have seen earlier how the 3x+1 tree can be compressed into a tree containing only odd numbers. This page describes a further modification that brings us to another tree, this time containing all the integers starting at 1. This transformation takes two parts. The first is to notice that all the all the predecessors of a number form a series, where each is four times the previous one, plus one. Redirecting the arrows in the tree so that the decent follows this path rather than going directly to the next odd number transforms the tree on the left to the one on the right.

In this tree no node has more than two other nodes converging on it, so working back is as easy as working forward.

The second transformation is to notice that, as all the numbers in the tree are odd we can map them onto the sequence of integers by making the transformation k→(k+1)/2.

The first 6 rows in this new tree are shown below. The loop from '1' to '1' has been omitted. The colour scheme is based on modulo three.

The forward and reverse transformations are:

Forward Reverse
x % 4
  0: x → 3x / 2
  1: x → (3x + 1) / 4
  2: x → 3x / 2
  3: x → (x + 1) / 4
x % 3
  0: x → [4x - 1, 2x / 3]
  1: x → [4x - 1, (4x - 1) / 3]
  2: x → [4x - 1]

The above tree was actually generated using the reverse transformation and shows all the values in the first seven rows. If we construct the tree in the forward direction, using seeds up to 20, we get the tree on the left. Note that 14, which is quite remote from the root corresponds to 27 in the original 3x+1 equation.

The images below compares the glide structures calulated using the standard 3x+1 equation and this 4n-1 alternative.


3x+1 Glide Tree

4n-1 Glide Tree

The two trees are different because the (x-1)/4 step interrupts some potential glides, for instance, the 15 glide in 3x+1 looks like [15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10], which appears as 15→5 (we ignore the even numbers so 10 becomes 5). With the 4n-1 step included, 53 is followed by 13 (rather than 160), so the glide becomes 15→13, which translates to 8→7 in the 4n-1 tree.

Glide Records

How do the glide records in this scheme compare with those in 3x+1? The first three columns show glide records in this scheme for numbers up to 30 million. The column on the right shows the first 12 glide records in the 3x+1 scheme.

LengthStartEnd 3x+1 equivalent
111 1
321 3→1
542 7→5
42148 27→23
60352105 703→157
7450444556 10087→961
97178289802 35655→29405
12013513653611 270271→2513
12318117253906 362343→161717
--------- 381727→161717
--------- 626331→597017
131333688141365 ---
133513716206580 1027431→619739
170563008261699 1126015→98137
17540440322143577  
21367108366167584  
217133583368740139  
2282846247813257640  

Larger view of the tree

Here is the complete tree extended to 10 rows. I include this to demonstrate that the trend to concentrate particular colours (x Mod 3) in the first few rows isn't continued as the tree grows.

Searching for Loops

To search for loops agorithmically we need to combine a sequence of iteration steps into an equation of the form f(x) = x.

There are three types of iteration step, x→3x/2, x→(3x+1)/4 and x→(x+1)/4. If we convert these to equations we get:

  • 3x = 2x ⇒ x = 0
  • 3x+1 = 4x ⇒ x = 1
  • x+1 = 4x ⇒ x = 1/3

Which gives us two integer solutions, x = 0 and x = 1. For two iterations there are 9 equations:

  • (3x + 0)/2 ⊕ (3x + 0)/2 = (9x + 0)/4 ⇒ 9x = 4x ⇒ x = 0
  • (3x + 0)/2 ⊕ (3x + 1)/4 = (9x + 3)/8 ⇒ 9x + 3 = 8x ⇒ x = -3
  • (3x + 0)/2 ⊕ (1x + 1)/4 = (3x + 3)/8 ⇒ 3x + 3 = 8x ⇒ x = 3/5
  • (3x + 1)/4 ⊕ (3x + 0)/2 = (9x + 2)/8 ⇒ 9x + 2 = 8x ⇒ x = -2
  • (3x + 1)/4 ⊕ (3x + 1)/4 = (9x + 7)/16 ⇒ 9x + 7 = 16x ⇒ x = 1
  • (3x + 1)/4 ⊕ (1x + 1)/4 = (3x + 7)/16 ⇒ 3x + 7 = 16x ⇒ x = 7/13
  • (1x + 1)/4 ⊕ (3x + 0)/2 = (3x + 2)/8 ⇒ 3x + 2 = 8x ⇒ x = 2/5
  • (1x + 1)/4 ⊕ (3x + 1)/4 = (3x + 5)/16 ⇒ 3x + 5 = 16x ⇒ x = 5/13
  • (1x + 1)/4 ⊕ (1x + 1)/4 = (1x + 5)/16 ⇒ x + 5 = 16x ⇒ x = 1/3

"f(x) ⊕ g(x)" is equivalent to "f(g(x))".

These equations show that there is a 2-cycle [-2,-3] which is probably the cycle that all negative numbers convege on. The 1-cycle solutions [0, 1/3, 1] are repeated, as solutions to f(x) = 0 will also be solutions to f(x)⊕f(x) = 0.

All the operations in this table are of the form x → (3n * x + k) / 2m, so we can simplify the notation by replacing the expressions with 3-tuples (n,k,m). We can then define the operation ⊕ as:

(n1,k1,m1) ⊕ (n2,k2,m2) = (n1+n2, k2*3n1 + k1*2m2, m1+m2)

In this notation the list looks like

  • (1, 0, 1) ⊕ (1, 0, 1) = (2, 0, 2)
  • (1, 0, 1) ⊕ (1, 1, 2) = (2, 3, 3)
  • (1, 0, 1) ⊕ (0, 1, 2) = (1, 3, 3)
  • (1, 1, 2) ⊕ (1, 0, 1) = (2, 2, 3)
  • (1, 1, 2) ⊕ (1, 1, 2) = (2, 7, 4)
  • (1, 1, 2) ⊕ (0, 1, 2) = (1, 7, 4)
  • (0, 1, 2) ⊕ (1, 0, 1) = (1, 2, 3)
  • (0, 1, 2) ⊕ (1, 1, 2) = (1, 5, 4)
  • (0, 1, 2) ⊕ (0, 1, 2) = (0, 5, 4)

Notice the operation isn't commutative, A⊕B ≠ B⊕A. However, if A=(n1,k2,m1), B=(n2, k2, m2) and C=(n3, k3, m3) then

A⊕(B⊕C) = (A⊕B)⊕C = (n1+n2+n2, k1*2(m2+m3) + k2*2m3*3n1 + k3*3(n1+n2), m1+m2+m3).

So the operation is associative. To find a loop we need to find a tuple (n,k,m) such that

   x = (3n * x + k) / 2m
⇒ 3n * x + k = x * 2m
⇒ k = (2m - 3n) * x
⇒ x = k / (2m - 3n)

For potential 3-cycles there are 27 permutations. All the members of a potential loop will have the same m and n values, as these don't depend on the order the tuples are combined. If we label the three atoms A=(1,0,1), B=(1,1,2) and C=(0,1,2) then the n value will be NA + NB and m will be 2*(NB+NC)+NA, where NA is the number of As in the cycle, etc. The 27 potential loop values are showin in the following table, organised into 11 potential loops.

LoopTuples k Values 2m - 3n Category
AAA (3, 0, 3) 0 -19 0
AAB, BAA, ABA (3, 9, 4), (3, 4, 4), (3, 6, 4) 9, 4, 6 -11 < 0
ABB, BBA, BAB (3, 21, 5), (3, 14, 5), (3, 17, 5) 21, 14, 17 5 > 1
AAC, CAA, ACA (2, 9, 4), (2, 4, 4), (2, 6, 4) 9, 4, 6 7 0 - 1
ABC, CAB, BCA (2, 21, 5), (2, 11, 5), (2, 14, 5) 21, 11, 14 23 0 - 1
ACB, BAC, CBA (2, 15, 5), (2, 17, 5), (2, 10, 5) 15, 17, 10 23 0 - 1
ACC, CAC, CCA (1, 15, 5), (1, 11, 5), (1, 10, 5) 15, 11, 10 29 0 - 1
BBB (3, 37, 6) 37 37 1
BBC, BCB, CBB (2, 37, 6), (2, 31, 6), (2, 23, 6) 37, 31, 23 55 0 - 1
BCC, CBC, CCB (1, 31, 6), (1, 23, 6), (1, 21, 6) 31, 23, 21 61 0 - 1
CCC (0, 21, 6) 21 63 1/3

The only combination that produces values greater than one is ABB. When searching for larger loops we can eliminate the cases where all the terms are the same AA...A, BB...B, CC...C as these always lead to x values of [0, 1, 1/3]. We can also eliminate those cases where (2*(NB+NC)+NA)/(NA+NB) < log(3)/log(2), as these will be negative. The best place to search for loops is where 2m is only slightly greater than 3n, though as 'n' amd 'm' get larger "slightly" is only a relative term. For 4-cycles we can use these two constraints to eliminate loops based on AAAA, AAAB, AABB, BBBB and CCCC.

Comparison with the standard 3x+1

For any pair of 'm' and 'n' values we need to find values of k such that k /( 2m - 3n) is an integer. This is exactly the same problem that we had with the standard approach. The difference here is that the 'm' and 'n' values don't relate directly to the loop size. The standard equation with n=3 and m=5 generates the seeds [19, 31, 49, 23, 37, 29]. To find the corresponding seeds in this scheme we need to locate those potential loops where 2*(NB+NC)+NA = 5 and NA+NB = 3. The only possible loops with this constraint are based on ABB and AAAC. These give the potential seed values 14,17,21 and 8,12,18,27. These are different from the values in the classic equation.

Visits since April 2005: