OEIS/3x+1 Problem: Difference between revisions

From tehowiki
Jump to navigation Jump to search
imported>Gfis
Duplicates
imported>Gfis
Tree
Line 9: Line 9:
* Jeffry C. Lagarias, Ed.: ''The Ultimate Challenge: The 3x+1 Problem'', Amer. Math. Soc., 2010, ISBN 978-8218-4940-8. [http://www.ams.org/bookpages/mbk-78 MBK78]
* Jeffry C. Lagarias, Ed.: ''The Ultimate Challenge: The 3x+1 Problem'', Amer. Math. Soc., 2010, ISBN 978-8218-4940-8. [http://www.ams.org/bookpages/mbk-78 MBK78]
* OEIS A07165: [http://oeis.org/A070165/a070165.txt  File of first 10K Collatz sequences], ascending start values, with lengths
* OEIS A07165: [http://oeis.org/A070165/a070165.txt  File of first 10K Collatz sequences], ascending start values, with lengths
* Gottfried Helms: ''[http://go.helms-net.de/math/collatz/aboutloop/collatzgraphs.htm The Collatz-Problem]''. A view into some 3x+1-trees and a new fractal graphic representation. Univ. Kassel.
* Manfred Trümper: ''The Collatz Problem in the Light of an Infinite Free Semigroup''. Chinese Journal of Mathematics, Vol. 2014, [http://dx.doi.org/10.1155/2014/756917 Article ID 756917], 21 p.
* Klaus Brennecke: ''[https://de.wikibooks.org/wiki/Collatzfolgen_und_Schachbrett Collatzfolgen und Schachbrett]'', on Wikibooks
==Collatz Graph==
==Collatz Graph==
When all Collatz sequences are read backwards, they form the '''Collatz graph''' starting with 1, 2, 4, 8 ... . At each node m > 4 in the graph, the path from the root (4) can be continued
When all Collatz sequences are read backwards, they form the '''Collatz graph''' starting with 1, 2, 4, 8 ... . At each node m > 4 in the graph, the path from the root (4) can be continued
Line 72: Line 71:
The first column(s) <nowiki>C[i,1]</nowiki> will be denoted as the ''left part'' of the segment (or of the whole directory), while the columns  <nowiki>C[i,j], j &gt; 1</nowiki> will be the ''right part''.  
The first column(s) <nowiki>C[i,1]</nowiki> will be denoted as the ''left part'' of the segment (or of the whole directory), while the columns  <nowiki>C[i,j], j &gt; 1</nowiki> will be the ''right part''.  


* All nodes in the segment directory are of the form 6 * n - 2.
* (C1) All nodes in the segment directory are of the form 6 * n - 2.
: This follows from the formula for columns <nowiki>C[i,1..3]</nowiki>, and for any higher column numbers from the 3-by-2 replacement property of the &sigma; operation.  
: This follows from the formula for columns <nowiki>C[i,1..3]</nowiki>, and for any higher column numbers from the 3-by-2 replacement property of the &sigma; operation.  
* All segments have a finite length.
* (C2) All segments have a finite length.
: At some point the &sigma; operations will have replaced all factors 3 by 2.
: At some point the &sigma; operations will have replaced all factors 3 by 2.
* All nodes in the right part of a segment have the same kernel.
* (C3) All nodes in the right part of a segment have the same kernel.
: This follows from the formula for columns <nowiki>C[i,1..3]</nowiki>, and since the &sigma; operation maintains this property.  
: This follows from the formula for columns <nowiki>C[i,1..3]</nowiki>, and since the &sigma; operation maintains this property.  
* All nodes in the right part of a segment are different.
* (C4) All nodes in the right part of a segment are different.
: For <nowiki>C[i,1..2]</nowiki> we see that the values modulo 24 are different. For the remaining columns, we see that the exponents of the factors 2 and 3 are different. They are shifted by the &sigma; operations, but they alternate, for example (right part of segment starting with 40, kernel 1):
: For <nowiki>C[i,1..2]</nowiki> we see that the values modulo 24 are different. For the remaining columns, we see that the exponents of the factors 2 and 3 are different. They are shifted by the &sigma; operations, but they alternate, for example (right part of segment starting with 40, kernel 1):
  160 = 6 * 3<sup>3</sup> * 2<sup>0</sup> - 2
  160 = 6 * 3<sup>3</sup> * 2<sup>0</sup> - 2
Line 87: Line 86:
   22 = 6 * 3<sup>0</sup> * 2<sup>2</sup> - 2
   22 = 6 * 3<sup>0</sup> * 2<sup>2</sup> - 2
   46 = 6 * 3<sup>0</sup> * 2<sup>3</sup> - 2
   46 = 6 * 3<sup>0</sup> * 2<sup>3</sup> - 2
* There is no cycle in a segment.
* (C5) There is no cycle in a segment.
===Segment Lengths===
===Segment Lengths===
The segment directories are obviously very structured. The lengths of the compressed segments follow the pattern
The segment directories are obviously very structured. The lengths of the compressed segments follow the pattern
Line 108: Line 107:
|}
|}
We can always exclude the first and the third element remaining so far by looking in the next two columns of segments with sufficient length.  
We can always exclude the first and the third element remaining so far by looking in the next two columns of segments with sufficient length.  
* There is no limit on the length of a segment.
* (C6) There is no limit on the length of a segment.
: We only need to take a segment which, in its right part, has a factor of 3 with a sufficiently high power, and the &sigma; operations will stretch out the segment accordingly.
: We only need to take a segment which, in its right part, has a factor of 3 with a sufficiently high power, and the &sigma; operations will stretch out the segment accordingly.
Therefore we can continue the modulus table above indefinitely, which leads us to the claim:
Therefore we can continue the modulus table above indefinitely, which leads us to the claim:
* '''All numbers of the form 6 * n - 2 occur exactly once''' in the right part <nowiki>C[i,j], j &gt; 1</nowiki> of the segment directory.
* (C7) '''All numbers of the form 6 * n - 2 occur exactly once''' in the right part <nowiki>C[i,j], j &gt; 1</nowiki> of the segment directory.
===Connectivity===
 
We now aim to build a (directed) tree with nodes of the form 6 * n - 2. We take the segment starting at 4:
===Segment Tree===
4 -&gt; 16 -&gt; 4 -&gt; 10
We now construct a subgraph of the Collatz graph connecting all nodes for the form 6 * n - 2. We take all segments and  we ''attach'' (connect, identify) the starting node <nowiki>C[i,1]</nowiki> (except for 4) at the unique occurrence of that node in the right part of some other segment in the directory.
and for any node x in the right part (x &gt; 4) we connect the segment starting with x with the current segment. We repeat this process for all additionally connected segments.
 
Example: Segment for 4 with segments for 16 and 10 attached:
  4 -&gt; 16 -&gt; 4 -&gt; 10
  4 -&gt; 16 -&gt; 4 -&gt; 10
       |          |
       |          |
Line 121: Line 121:
       64 -&gt; 256  40 -&gt; 160 -&gt; 52 -&gt; 106 -&gt; 34 -&gt; 70 -&gt; 22 -&gt; 46  
       64 -&gt; 256  40 -&gt; 160 -&gt; 52 -&gt; 106 -&gt; 34 -&gt; 70 -&gt; 22 -&gt; 46  
       ...
       ...
* The process does not reach a cycle.
* (C8) '''The constructions creates a tree''' with root 4.
: A cyle would contain a node which is entered by two edges. That would violate the uniqueness of the nodes in the right part of the segment directory.  
: For any two nodes n<sub>1</sub> and n<sub>2</sub> in the graph, we may successively build two subpaths by stepping towards the root (to the left in a segment, and at the <nowiki>C[i,1]</nowiki> to the unique occurrence of that node in the right part of the segment directory), until we encounter a common node. This node connects the two subpaths to a unique path between the two nodes n<sub>1</sub> and n<sub>2</sub>. That establishes the condition for a [https://en.wikipedia.org/wiki/Tree_(graph_theory)#Tree tree].
* The process will never stop.
* (C9) The construction does not create any cycle.
: All nodes added by a segment are different from those already in the tree.
: A cycle would contain a node which is entered by two edges. That would violate the uniqueness of the nodes in the right part of the segment directory.  
* The process reaches all segments.
: (This is not shown so far.)
===Detailed Segment Directory===
===Detailed Segment Directory===
Once the coverage and the connectivity and cycle-freeness of the segments is established, we switch back to the full Collatz graph. We feaze the segment, and we list the intermediate results of the operations in two separate rows:
Once the coverage, connectivity and cycle-freeness of the segment tree is established, we switch back to the full Collatz graph. We feaze the segment, and we list the intermediate results of the operations in two separate rows:
{| class="wikitable" style="text-align:center"                                                     
{| class="wikitable" style="text-align:center"                                                     
|-       
|-       

Revision as of 20:21, 22 September 2018

Introduction

Collatz sequences are sequences of non-negative integer numbers with a simple construction rule:

Even elements are halved, and odd elements are multiplied by 3 and then incremented by 1.

Since decades it is unknown whether the final cyle 4 - 2 - 1 is always reached for any start value. This problem is the Collatz conjecture, for which the english Wikipedia states:

It is also known as the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Sir Bryan Thwaites), Hasse's algorithm (after Helmut Hasse), or the Syracuse problem; the sequence of numbers involved is referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers.

Straightforward visualizations of the Collatz sequences no obvious structure. The sequences for the first dozen of start values are rather short, but the sequence for 27 suddenly has 112 elements.

References

  • Jeffry C. Lagarias, Ed.: The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010, ISBN 978-8218-4940-8. MBK78
  • OEIS A07165: File of first 10K Collatz sequences, ascending start values, with lengths
  • Manfred Trümper: The Collatz Problem in the Light of an Infinite Free Semigroup. Chinese Journal of Mathematics, Vol. 2014, Article ID 756917, 21 p.

Collatz Graph

When all Collatz sequences are read backwards, they form the Collatz graph starting with 1, 2, 4, 8 ... . At each node m > 4 in the graph, the path from the root (4) can be continued

  • always to m * 2, and
  • to (m - 1) / 3 if m ≡ 1 mod 3.

When m ≡ 0 mod 3, the path will continue with duplications only, since these maintain the divisibility by 3.

The Collatz conjecture claims that the graphs contains all numbers, and that - except for the leading cycle 1 - 2 - 4 - 1 - 2 - 4 ... - it has the form of a tree without cycles. We will not be concerned with this cycle, and we start with node 4, the root.

Graph Operations

Following Trümper, we use abbreviations for the elementary operations which transform a node (element, number) in the Collatz graph:

Name Mnemonic Distance to root Mapping Condition
d down -1 m ↦ m / 2 m ≡ 0 mod 2
u up -1 m ↦ 3 * m + 1 (none)
s := ud spike -2 m ↦ (m / 2) * 3 + 1 m ≡ 0 mod 2
δ divide +1 m ↦ (m - 1) / 3 m ≡ 1 mod 3
µ multiply +1 m ↦ m * 2 (none)
σ := δµ step +2 m ↦ ((m - 1) / 3) * 2 m ≡ 1 mod 3

We will mainly be interested in the reverse mappings (denoted with greek letters) which move away from the root of the graph.

3-by-2 Replacement

The σ operation, applied to numbers of the form 6 * m - 2, has an interesting property:

(6 * (3 * n) - 2) σ = 4 * 3 * n - 2 =  6 * (2 * n) - 2

In other words, as long as m contains a factor 3, the σ operation maintains the form 6 * x - 2, and it replaces the factor 3 by 2. In the opposite direction, the s operation replaces a factor 2 in m by 3.

Kernels

By the kernel of a number n = 6 * m - 2 we denote the "2-3-free" factor of m, that is the factor which remains when all powers of 2 and 3 have been removed from m.

  • The kernel is not affected by σ and s operations.

Segment Construction

We will now construct special subsets of paths in the Collatz graph which we call segments. They lead away from the root, and they always start with a node m ≡ -2 mod 6. Then they split and follow two subpaths in a prescribed sequence of operations. The segment construction process is stopped when the next node in one of the two subpaths is divisible by 3, resp. when a δ operation is no more possible. We assemble the segments as rows of an infinite array C[i,j], the so-called segment directory. One row i of C is constructed according to the following table:

Column Operation Formula Condition Sequence
C[i,1] 6 * i - 2 4, 10, 16, 22, 28, ...
C[i,2] C[i,1] µµ 24 * (i - 1) + 16 16, 40, 64, 88, 112, ...
C[i,3] C[i,1] δµµ 24 * (i - 1) / 3 + 4 i ≡ 1 mod 3 4, 28, 52, 76, 100, ...
C[i,4] C[i,2] σ 48 * (i - 1) / 3 + 10 i ≡ 1 mod 3 10, 58, 106, 134, ...
C[i,5] C[i,3] σ 48 * (i - 7) / 9 + 34 i ≡ 7 mod 9 34, 82, 130, 178, ...
C[i,6] C[i,2] σσ 96 * (i - 7) / 9 + 70 i ≡ 7 mod 9 70, 166, 262, 358, ...
C[i,7] C[i,3] σσ 96 * (i - 7) / 27 + 22 i ≡ 7 mod 27 22, 118, 214, 310, ...
C[i,8] C[i,2] σσσ 192 * (i - 7) / 27 + 46 i ≡ 7 mod 27 46, 238, 430, 622, ...
C[i,9] C[i,3] σσσ 192 * (i - 61) / 81 + 142 i ≡ 61 mod 81 142, 334, ...
... ... ... ... ...

The first column(s) C[i,1] will be denoted as the left part of the segment (or of the whole directory), while the columns C[i,j], j > 1 will be the right part.

  • (C1) All nodes in the segment directory are of the form 6 * n - 2.
This follows from the formula for columns C[i,1..3], and for any higher column numbers from the 3-by-2 replacement property of the σ operation.
  • (C2) All segments have a finite length.
At some point the σ operations will have replaced all factors 3 by 2.
  • (C3) All nodes in the right part of a segment have the same kernel.
This follows from the formula for columns C[i,1..3], and since the σ operation maintains this property.
  • (C4) All nodes in the right part of a segment are different.
For C[i,1..2] we see that the values modulo 24 are different. For the remaining columns, we see that the exponents of the factors 2 and 3 are different. They are shifted by the σ operations, but they alternate, for example (right part of segment starting with 40, kernel 1):
160 = 6 * 33 * 20 - 2
 52 = 6 * 32 * 20 - 2
106 = 6 * 32 * 21 - 2
 34 = 6 * 31 * 21 - 2
 70 = 6 * 31 * 22 - 2
 22 = 6 * 30 * 22 - 2
 46 = 6 * 30 * 23 - 2
  • (C5) There is no cycle in a segment.

Segment Lengths

The segment directories are obviously very structured. The lengths of the compressed segments follow the pattern

4 2 2 4 2 2 L1 2 2 4 2 2 4 2 2 L2 2 2 4 2 2 ...

with two fixed lengths 2 and 4 and some variable lengths L1, L2 ... > 4. At the starting values 4, 40, 364, 3280, 29524 (OEIS A191681), the segment lengths have high values 4, 8, 12, 16, 20 which did not occur before. Those starting values are (9n+1 - 1) / 2, or 4 * Sum(9i, i=0..n).

Coverage of the Right Part

We now examine the modular conditions which result from the segment construction table in order to find out how the numbers of the form 6 * n -2 are covered by the right part of the segment directory:

Columns j Covered Remaining
2-3 4, 16 mod 24 10, 22, 34, 46 mod 48
3-4 10, 34 mod 48 22, 46, 70, 94 mod 96
5-6 70, 22 mod 96 46, 94, 142, 190 mod 192
7-8 46, 142 mod 192 94, 190, 286, 382 mod 384
... ... ...

We can always exclude the first and the third element remaining so far by looking in the next two columns of segments with sufficient length.

  • (C6) There is no limit on the length of a segment.
We only need to take a segment which, in its right part, has a factor of 3 with a sufficiently high power, and the σ operations will stretch out the segment accordingly.

Therefore we can continue the modulus table above indefinitely, which leads us to the claim:

  • (C7) All numbers of the form 6 * n - 2 occur exactly once in the right part C[i,j], j > 1 of the segment directory.

Segment Tree

We now construct a subgraph of the Collatz graph connecting all nodes for the form 6 * n - 2. We take all segments and we attach (connect, identify) the starting node C[i,1] (except for 4) at the unique occurrence of that node in the right part of some other segment in the directory.

Example: Segment for 4 with segments for 16 and 10 attached:

4 -> 16 -> 4 -> 10
      |          |
      V          V
     64 -> 256  40 -> 160 -> 52 -> 106 -> 34 -> 70 -> 22 -> 46 
     ...
  • (C8) The constructions creates a tree with root 4.
For any two nodes n1 and n2 in the graph, we may successively build two subpaths by stepping towards the root (to the left in a segment, and at the C[i,1] to the unique occurrence of that node in the right part of the segment directory), until we encounter a common node. This node connects the two subpaths to a unique path between the two nodes n1 and n2. That establishes the condition for a tree.
  • (C9) The construction does not create any cycle.
A cycle would contain a node which is entered by two edges. That would violate the uniqueness of the nodes in the right part of the segment directory.

Detailed Segment Directory

Once the coverage, connectivity and cycle-freeness of the segment tree is established, we switch back to the full Collatz graph. We feaze the segment, and we list the intermediate results of the operations in two separate rows:

6*i-2 µ µµ µµδ µµδµ µµδµδ µµδµδµ ...
δ δµ δµµ δµµδ δµµδµ δµµδµδ ...

We call such a construction a detailed segment (in contrast to the compressed segments described above). A detailed segment directory can easily be created by a Perl program.

  • The connections between the segments via the nodes 6 * i - 2 remain unaffected.

From a segment start of the form 6 * i - 2 we reach the numbers x according to the following table:

Number Operation Remark
x ≡ 1, 3, 5 mod 6 (6 * i - 2) δ = 2 * i - 1 all odd numbers
x ≡ 0 mod 6 (3p) µq odd multiples of 3 times powers of 2
x ≡ 8 mod 12 (6 * i - 2) µ 8, 20, 32, 44, ...
x ≡ 2 mod 12 (6 * i - 2) δµ if i ≡ 1 mod 3 2, 14, 26, 38, ...

Together this shows that we can reach all numbers x ≡ 0, 1, 2, 3, 5 mod 6 which are not contained in the right part of the compressed segment directory.

Duplicated Nodes

This straightforward construction of the detailed segments introduces duplications of nodes in the right part. We make the following observations:

  • Odd numbers occur exactly twice, once in column S[i,2], and once in the right part.
  • Iff a number ≡ 2 mod 6 occurs at the end of an S row, it occurs twice.