The 4n-1 Modification

  1. Introduction
  2. The Reverse Tree
  3. The Forward Tree
  4. Glide Structure
  5. Glide Records
  6. Larger View of the Tree
  7. 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 retains all the odd numbers but aranges them into a simpler tree where each node has only one or two precursors. 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.

The Reverse Tree

This image shows the first 7 rows of the reverse tree anchored at 1.

The colour scheme has been expanded to colour values of the form 8n+5 in yellow. To constuct the reverse tree we start at the root and then calculate the predecessors using the algorithm


def previous(x):

    if x == 1:
        return [5]

    r = x % 6

    n1 = 4 * x + 1

    if r == 1:
        return [n1, (4 * x - 1) / 3]

    if r == 5:
        return [n1, (2 * x - 1) / 3]
    
    return [n1]

This shows that every value 'x' has a precursor of the forn 4x+1. Values of the form 6x+1 have a precursor (4x-1)/3 and those of the form 6n+5 one of (2x-1)/3. So all values have a yellow precursor and 2/3rds have a red, green or blue one.

So although yellow values only form 25% of the set of integers they will occupy roughly 60% of each row in this tree.

The above algorithm makes 1 a special case as it is is own precursor.

Forward Tree

As the yellow squares tend to hog to bottom of the tree the other colours are forced further out. The image on the left shows the smallest tree that contains the odd numbers 0 - 29.

It is 49 rows deep and contains only 10 yellow cells out of 59.

So it seems that forward trees are disproportionately short of yellow cells while reverse trees have an excess. This property or reverse trees will always be true because of the nature of the reverse algorithm, the forward tree situation might just be by chance.

Glide Structure

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 translates to 15→5 when we ignore the even numbers. In the 4n-1 scheme 53 is followed by 13 (rather than 160), so the glide becomes 15→13.

Glide Records


         Length        Start            End

              2            1 →            1
              3            3 →            1
              5            7 →            3
             42           27 →           15
             60          703 →          209
             74        10087 →         9111
             97        35655 →        19603
            120       270271 →       107221
            123       362343 →       107811
            131       667375 →       282729
            133      1027431 →       413159
            170      1126015 →       523397
            175      8088063 →      4287153

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: