The 3n + 1 problem
The $3n + 1$ problem can be described as a set of simple rules. For any positive integer apply the following two rules:
- If the number is even: divide by 2
- If the number is odd: multiply by 3 and add 1
Here is an example:
7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 -> 4 ...
Collatz conjecture
One thing to notice in the example above is that the pattern ends in a 1 -> 4 -> 2 -> 1
cycle. Collatz has conjectured this will always happen, for each positive starting integer.
Proving/disproving Collatz
To prove or disprove this conjecture someone will need to:
- Find a counter example: a number grows forever or another cycle.
- Prove that a cycle can't exist.
- Prove that all odd numbers can be generated by other numbers working backwards.
People have been using super computers to crunch numbers to find a counter example to the Collatz conjecture. As of 2020 people have checked up to $2^{68}$, and all examples end up in the same 1 -> 4 -> 2 -> 1
cycle.
We could state that, for a second cycle to exist, there has to be some specific properties of the numbers inside the cycle. For example, every cycle has one lowest number in it; and for any repeating cycle it can't have $6n + 3$ numbers in it (more on that later).
This lowest number in a cycle might have some very specific properties that only $1$ has, thus making a second cycle impossible.
Generating numbers (working backwards)
A final way to prove the Collatz conjecture is to show that all other numbers can be created by starting at $1$.
Lets take a closer look at all the numbers involved.
Even numbers can easily be ignored, they will (in a cycle) always get divided down to an odd number. Because every even number is an odd number multiplied by a power of two.
For example $80$ comes down to 80 -> 40 -> 20 -> 10 -> 5
. Because of this we can just focus on the odd numbers in the $3n + 1$ problem.
Splitting the odd numbers
The numbers that we need to focus on are:
$$2n + 1$$
These are all the odd numbers. Let's split these numbers into three equal groups:
$$a = 6n + 1$$ $$b = 6n + 3$$ $$c = 6n + 5$$
We can show that these groups all uniquely contain the odd numbers:
$$a [1, 7, 13, 19, 27...]$$ $$b [3, 9, 15, 21, 29...]$$ $$c [5, 11, 17, 23, 31...]$$
Going a single "Collatz" step back from an odd number means multiplying by 2, this creates new even numbers:
$$a_1 = 12n + 2$$ $$b_1 = 12n + 6$$ $$c_1 = 12n + 10$$
$a_1 - 1$ and $b_1 - 1$ are not divisible by three and have no odd predecessor at this depth.
$c_1 - 1$ is divisible by three and it creates a pattern: $4n + 3$
This implies that from every number in the form $6n + 5$, going one step back in the Collatz sequence, we can generate all $4n + 3$ formed numbers.
When multiplying $a_1$, $b_1$ and $c_1$ again by two (going a deeper step back) we get:
$$a_2 = 24n + 4$$ $$b_2 = 24n + 12$$ $$c_2 = 24n + 20$$
$b_2 - 1$ and $c_2 - 1$ are not divisible by three thus have no odd predecessor at this depth.
$a_2 - 1$ is divisible, and reveals pattern: $8n + 1$
Special case: 6n + 3
Because b
is in the form $6n + 3$, multiplying by two will never result in a number that minus one is divisible by three. This means that odd numbers of form $6n + 3$ have no odd numbers preceding them.
This allows us to focus completely on $6n + 1$ and $6n + 5$ form numbers.
Pattern equations
For a
and c
we can come up with the following equations:
$$a = \frac{2^{2k} (6n + 1) - 1}{3}$$ $$c = \frac{2^{2 k + 1} (6 n + 5) - 1}{3}$$
Depth $k$ determines how deep we travel backwards (multiplying by two). The values for $k$ from the equations are:
\begin{array}{|c|c|c|} \hline k & a & c \\ \hline 1 & 8n + 1 & 4n + 3 \\ \hline 2 & 32n + 5 & 16n + 13 \\ \hline 3 & 128n + 21 & 64n + 53 \\ \hline 4 & 512n + 85 & 256n + 213 \\ \hline 5 & ... & ... \\ \hline \end{array}
All the odd numbers that could be in a repeating cycle now have a method to calculate all their preceding odd numbers at different depths of $k$.
At a depth of $k=1$ we get the following information as mentioned above:
$6n + 1$ and $6n + 5$ numbers will generate patterns:
$8n + 1$ and $4n + 3$
This means all numbers in the forms: $8n + 1$, $8n + 3$ and $8n + 7$ can be generated.
After $k=1$ we just miss the numbers in the form $8n + 5$.
Next we look at $k=2$, the new additions are: $32n + 5$ and $16n + 13$. Scaling everything to $32n$ we can see that we can now form all odd numbers except in the form $32n + 21$.
One level deeper again and the patterns added are: $128n + 21$ and $64n + 53$. This means that we can now form all odd numbers except those in the form $128n + 85$.
If this process is repeated, we can see that all odd numbers can be generated starting from just $6n + 1$ and $6n + 5$.
Density
The amount of odd numbers that can be calculated are:
$$\frac{4^k-1}{4^k}$$
The largest number that, at depth $k$, can't yet be created is equal to:
$$ 2 \cdot 4^{k+1}n + \frac{4^{k+2}-1}{3}$$ This results in the following table for small values of $k$:
\begin{array}{|l|l|l|l|} \hline k & Missing & Density & Percentage \\ \hline 1 & 8n + 5 & \frac{3}{4} & 0.75 \\ \hline 2 & 32n + 21 & \frac{15}{16} & 0.9375 \\ \hline 3 & 128n + 85 & \frac{63}{64} & 0.984375 \\ \hline 4 & 512n + 341 & \frac{255}{256} & 0.99609375 \\ \hline 5 & 2048n + 1365 & \frac{1023}{1024} & 0.9990234375 \\ \hline 6 & 2 \cdot 4^6n + 5461 & \frac{4095}{4096} & 0.9997.. \\ \hline 7 & 2 \cdot 4^7n + 21845 & \frac{16383}{16384} & 0.99993.. \\ \hline 8 & 2 \cdot 4^8n + 87381 & \frac{65535}{65536} & 0.99998.. \\ \hline 9 & 2 \cdot 4^9n + 349.525 & \frac{262143}{262144} & 0.999996.. \\ \hline 10 & 2 \cdot 4^{10} n + 1398101 & \frac{1048575}{1048576} & 0.99999904... \\ \hline .. & & & \\ \hline 100 & 2 \cdot 4^{100} n + 214..... & & 0.9999999999... \\ \hline & 2 \cdot 4^{k+1}n + \frac{4^{k+2}-1}{3} & \frac{4^k-1}{4^k} & \\ \hline \end{array}
After just $k=10$ steps we can generate $\frac{1048575}{1048576}$ of all existing odd numbers from the starting values $6n + 1$ and $6n + 5$. The lowest number we can't create is $2 \cdot 4^{10}n + 1398101$.
And after $k=100$ steps we're up to:
$$0.9999999999999999999999999999999999999999999999999999999999993777$$
Update:
Does this "prove" the Collatz conjecture?
Sadly: No.
There is one problem: We did show that each odd number can be made from $6n+1$ and $6n+5$. We haven't shown that this all happens from the number 1.
Update 2:
Suppose a second cycle exists. That cycle will have to have a lowest number, that is larger than 1 (obviously).
Can we prove this cycle doesn't exist? We can try.
First of all, we can still rule out any numbers in the form $6n+3$, these numbers have no preceding odd numbers and can therefor never be created in a cycle.
Now we have two options left, $6n+1$ (a
) or $6n+5$ (c
).
Let's look at the numbers in c
. They are in the form $6n+5$, and have smaller predecessors in the form $4n+3$. These are the only numbers that can make a cycle grow exist and odd numbers grow larger when running Collatz forward:
\begin{array}{|l|l|l|} \hline n & 4n + 3 \\ \hline 0 & 6 \cdot 0 + 3 \\ \hline 1 & 6 \cdot 1 + 1 \\ \hline 2 & 6 \cdot 1 + 5 \\ \hline 3 & 6 \cdot 2 + 3 \\ \hline 4 & 6 \cdot 3 + 1 \\ \hline 5 & 6 \cdot 3 + 5 \\ \hline 6 & 6 \cdot 4 + 3 \\ \hline 7 & 6 \cdot 5 + 1 \\ \hline 8 & 6 \cdot 5 + 5 \\ \hline 9 & 6 \cdot 6 + 3 \\ \hline 10 & 6 \cdot 7 + 1 \\ \hline 11 & 6 \cdot 7 + 5 \\ \hline \end{array}
From this we can conclude that we either:
- The smaller odd number before $4n+3$ is a smaller $6n+1$
- The smaller odd number before $4n+3$ has the form $6n+3$, a dead end
- The smaller odd number before $4n+3$ is a smaller $6n+5$, continue until (1) or (2) are reached (will happen by deduction).
This means that the only possible smallest odd number in a cycle can be in the form $6n+1$, a number from group a
.
Suppose we again split a
into two groups a1
and a2
:
$$a1 = 12n + 1$$ $$a2 = 12n + 7$$
These groups contain all $6n+1$ numbers, split equally.
If we now follow the sequence forward from our hypothetical lowest number in the cycle we get:
$$((12n + 1) * 3)+1 = 36n + 4$$ $$((12n + 7) * 3)+1 = 36n + 22$$
Next we divide the even numbers by two (according to the $3n+1$ rule) and get: $$(36n + 4)/2/2 = 9n + 1$$ $$(36n + 22)/2 = 18n + 11$$
This shows that a number in form a1
($12n + 1$) is not the lowest number of the hypothetical Collatz cycle because $9n + 1$ follows and is smaller.
So the lowest number in an hypothetical cycle must be $12n + 7$.
What next?
One could dive deeper into these $4n+3$ numbers; those are very special and allow a number to grow before going down to 1.
One could try to come up with a set of finite sub-trees that create the fractal like pattern the $3n+1$ problem has?
I'm giving up (for now) :)