OEIS/3x+1 Problem: Difference between revisions

From tehowiki
Jump to navigation Jump to search
imported>Gfis
compressed segments
imported>Gfis
coverage
Line 33: Line 33:
|}
|}
When moving towards the root (4) of the graph, d/u operations are used, while δ/µ operations are used to move away from the root.
When moving towards the root (4) of the graph, d/u operations are used, while δ/µ operations are used to move away from the root.
====Detailled Segment====
====Detailed Segment Construction====
We will now construct special portions of paths in the Collatz graph which we call ''segments''. They lead away from the root, and they always start with a node x ≡ 4 mod 6. Then they split into a ''northern'' and a ''southern'' subsegment by applying the following operations:
We will now construct special portions of paths in the Collatz graph which we call ''segments''. They lead away from the root, and they always start with a node x ≡ 4 mod 6. Then they split into a ''northern'' and a ''southern'' subsegment by applying the following operations:
* northern: µ µ δ µ δ µ δ ...
* northern: µ µ δ µ δ µ δ ...
* southern: δ µ µ δ µ δ µ ...
* southern: δ µ µ δ µ δ µ ...
The two subsegements are built in parallel, and the process is stopped when one of the two new nodes becomes divisible by 3, resp. when a δ operation is not possible.  
The two subsegements are built in parallel, and the process is stopped when one of the two new nodes becomes divisible by 3, resp. when a δ operation is not possible.


We will call these segments ''detailled'', and a '''[http://www.teherba.org/fasces/oeis/collatz/rails.html  segment directory]''' can easily be created by a [https://github.com/gfis/fasces/blob/master/oeis/collatz/collatz_rails.pl Perl program]. We will later come back to more properties of detailled segments.  
We will call these segments ''detailled'', and a '''[http://www.teherba.org/fasces/oeis/collatz/rails.html  segment directory]''' can easily be created by a [https://github.com/gfis/fasces/blob/master/oeis/collatz/collatz_rails.pl Perl program]. We will later come back to more properties of detailed segments.  


====Compressed Segements====
====Compressed Segments====
For the moment we will concentrate on the nodes x ≡ 4 mod 6 in the detailled segments (which are highlighted in the directory). For each segment we define a row i in an array C[i,j] as follows:
For the moment we will concentrate on the nodes x &#x2261; 4 mod 6 in the detailed segments (which are highlighted in the directory). For each segment we define a row i in an array <nowiki>C[i,j]</nowiki> as follows:
{| class="wikitable" style="text-align:center"
{| class="wikitable" style="text-align:center"
!C[i,1] !! C[i,2] !! C[i,3] !! C[i,4] !! C[i,5] !! C[i,6] !! C[i,7] !! ...           
!C[i,1] !! C[i,2] !! C[i,3] !! C[i,4] !! C[i,5] !! C[i,6] !! C[i,7] !! C[i,8] !! ...           
|-
|-
| 6*i-2  
| 6*i-2  
Line 50: Line 50:
| C[i,1] &delta;&micro;&micro;   
| C[i,1] &delta;&micro;&micro;   
| C[i,2] &delta;&micro;   
| C[i,2] &delta;&micro;   
| C[i,2] &delta;&micro; 
| C[i,3] &delta;&micro; 
| C[i,3] &delta;&micro;   
| C[i,3] &delta;&micro;   
| C[i,4] &delta;&micro; 
| C[i,5] &delta;&micro; 
| C[i,6] &delta;&micro; 
|...
|...
|}
|}
The row for the compressed segment is filled as long as the corresponding node in the detailled segment is &#x2261; 4 mod 6.
The row for the compressed segment is filled as long as the corresponding node in the detailed segment is &#x2261; 4 mod 6.  
====Street construction rules====
The following table shows the rules for the construction of the first 9 columns <nowiki>S[n,1..9]</nowiki> of row n (n = 1, 2, 3 ...) in the street directory:
{| class="wikitable" style="text-align:left"                                                   
|-     
!Column!! Steps !! Expression || Formula                !! Condition            !! Coverage
|-                                                                                                                                   
| 1||      ||      || 6n-2                              ||                      || 4,10,16,22 mod 24
|-
| 2|| d    || (6n-2-1)/3 || 2n-1                        ||                      || all odd numbers
|-                                                                           
| 3|| m    || (6n-2)*2 || 12n-4                        ||                      || 8,20 mod 24
|-                                                                           
| 4|| dm  || ((6n-2-1)/3)*2 || 4n-2                    ||                      || 2,6,10,14,18,22 mod 24
|-                                                                           
| 5|| mm  || (6n-2)*2*2 || 24n-8                      ||                      || 16 mod 24
|-                                                                               
| 6|| dmm  || ((6n-2-1)/3)*2*2 || 8n-4                  ||                      || 4,12,20 mod 24
|-                                                                               
| 7|| mmd  || ((6n-2)*2*2-1)/3 || 8n-3                  ||                      || 5,13,21 mod 24
|-
| 8|| dmmd || ((6n-2-1)/3)*2*2-1)/3 || (8n-5)/3        || n &#x2261; 1 mod 3  || (1,9,17,25 ...)
|-
| 9|| mmdm || ((6n-2)*2*2-1)/3)*2  || 16n-6            || n &#x2261; 1 mod 3  || (10,58,106,154, ...)
|}
The first 6 columns of the table cover the odd numbers and all numbers &#x2261; 2,4,6,8,10,12,16,18,20,22 mod 24.  


It is ''not shown'' so far that all multiples of 24 are contained in the table.
The segment directories are obviously very structured. The lengths of the compressed segments follow the pattern
<!-- ???
  4 2 2 4 2 2 m 2 2 4 2 2 4 2 2 n 2 2 4 2 2 ...
All odd multiples of 3 are contained in column 2. All multiples of 24 can be reached by duplicating them 3 times (3 m-steps).  
with two ''fixed lengths'' 2 and 4 and some ''variable lengths'' m, n ... &gt; 4. At the starting values 4, 40, 364, 3280, 29524 ([http://oeis.org/A191681 OEIS A191681]), the segment lengths  have high values 4, 8, 12, 16, 20 which did not occur before. Those starting values are (9<sup>n+1</sup> - 1) / 2, or 4 * Sum(9<sup>i</sup>, i=0..n).
-->
====Highlighted numbers====
The numbers of the form 6p-2 were highlighted in the example above. They have the special property that, when p &gt; 0 and p &#x2261; 0 mod 3, a dm-step yields a number of the same form, but with one factor 3 in p replaced by 2:
  6(3q)-2 dm ((6(3q)-2)-1)/3*2 = (6q-1)*2 = 6(2q)-2
This implies that a dm-step decreases any number by about one third.
====Street lengths &gt; 7====
* Columns 4(k+1)+1 result by dm-steps from columns 4k+1 for k=1,2,... (and so do columns 4(k+1)+2 result from columns 4k+2). Sequences of dm-steps decrease the numbers. Therefore the lengths of all streets are finite.  
* Column 5 is 24n-8, and the lengths depend on the power of 3 contained in that n.
<!--
* The street lengths show a repeating pattern for the start values mod 54. The fixed lengths 3, 4, 5 can probably be explained from the street construction rule.
{| class="wikitable" style="text-align:center"
| 4 mod 54
| 10 mod 54
| 16 mod 54
| 22 mod 54
| 28 mod 54
| 34 mod 54
| 40 mod 54
| 46 mod 54
| 52 mod 54
|-
| 5
| 3
| 3
| 4
| 3
| 3
| n
| 3
| 3
|}
-->
* At the starting values 4, 40, 364, 3280, 29524 ([http://oeis.org/A191681 OEIS A191681]) the street lengths  have high values 5, 9, 13, 17, 21 which did not occur before. Those starting values are (9<sup>n+1</sup> - 1) / 2, or 4 * Sum(9<sup>i</sup>, i=0..n).
====Coverage====
The elements of the streets are strongly interconnected, and the table "obviously" shows all positive integers which are not multiples of 24:
{| class="wikitable"
| r<sub>1</sub> &#x2261; 4 mod 6
| style="text-align:right" | &#x2261; 4,10,16,22 mod 24
|-
| r<sub>2</sub> &#x2261; 1 mod 2
| all odd numbers
|-
| r<sub>3</sub> &#x2261; 8 mod 12
| style="text-align:right" | &#x2261; 8,20 mod 24
|-
| r<sub>4</sub> &#x2261; 2 mod 4
| style="text-align:right" | &#x2261; 2,6,10,14,18,22 mod 24
|-
| r<sub>5</sub> &#x2261; 16 mod 24
| style="text-align:right" | &#x2261; 16 mod 24
|-
| r<sub>6</sub> &#x2261; 4 mod 8
| style="text-align:right" | &#x2261; 4,12,20 mod 24
|}


If we interprete the <nowiki>C[i,j]</nowiki> as 6*p - 2, we observe that factors 3 in p are successively replaced by factors 2 for increasing j &gt;= 2.
====Connectivity of Segments====
We now claim that all numbers of the form 6*p - 2 (<nowiki>C[i,1]</nowiki>, the ''left side'' ) occur exactly once in the ''right side'' <nowiki>C[i,j], j &gt; 1</nowiki>.


So if we can show that we reach all start values &#x2261; 4 mod 6, we have a proof that all positive integers are reached.
If this claim were proven, we could begin with the compressed segment for 4, and therein at every node &gt; 4 we "attach" a unique segment with that starting element. Doing this iteratively we could reach all numbers of the form 6*p - 2.
 
Starting with 4, it seems possible that a continuous expansion of all numbers &#x2261; 4 mod 6 into streets would finally yield all streets up to some start value. Experiments show that there are limits for the numbers involved. Streets above the ''clamp'' value are not necessary in order to obtain all streets below and including the ''start'' value:
{| class="wikitable"
! start value
! clamp value
|- style="text-align:right"
| 4  || 4
|- style="text-align:right"
| 40 || 76
|- style="text-align:right"
| 364 || 2308
|- style="text-align:right"
| 3280 || 143248
|}
==Subset table S==
We may build derived table from the table of streets. We take columns r<sub>0</sub> and r<sub>5</sub> ff., and therein we keep the highlighted entries (those which are &#x2261; 4 mod 6) only, add 2 to them and divide them by 6. The resulting subset table S starts as follows:
  s0  s1  s2  s3  s4  s5  s6  s7  s8  ...
  n  len 
  1  3    3    1    2
  2  1    7
  3  1  11
  4  3  15    5  10
  5  1  19
  6  1  23
  7  7  27    9  18    6  12    4    8
  8  1  31
  9  1  35
10  3  39  13  26
11  1  43
12  1  47
13  3  51  17  34
14  1  55
15  1  59
16  5  63  21  42  14  28
...
This table can be described by simple rules which are hopefully provable from the construction rule for the streets:
* s<sub>2</sub> is always s<sub>0</sub> * 4 - 1.
* When s<sub>2</sub> &#x2261; 0 mod 3, the following columns s<sub>3</sub>, s<sub>4</sub> ... are obtained by an alternating sequence of steps
** s<sub>i+1</sub> = s<sub>i</sub> / 3 and
** s<sub>i+2</sub> = s<sub>i+1</sub> * 2,
** until all factors 3 in s<sub>2</sub> are replaced by factors 2.
 
===Does S contain all positive integers?===
The answer is yes. As above, we can regard the increments in successive columns:
{| class="wikitable"
| s<sub>s</sub> &#x2261; 3 mod 4
| style="text-align:right" | half of the odd numbers
|-
| s<sub>3</sub> &#x2261; 1 mod 4
| style="text-align:right" | other half of odd numbers
|-
| s<sub>4</sub> &#x2261; 2 mod 8
| style="text-align:right" | &#x2261; 2,10 mod 16
|-
| s<sub>5</sub> &#x2261; 6 mod 8
| style="text-align:right" | &#x2261; 6,14 mod 16
|-
| s<sub>6</sub> &#x2261; 12 mod 16
| style="text-align:right" | &#x2261; 12 mod 16
|-
| s<sub>7</sub> &#x2261; 4 mod 16
| style="text-align:right" | &#x2261; 4 mod 16
|-
| s<sub>8</sub> &#x2261; 8 mod 32
| style="text-align:right" | 8, 40, 72, ...
|-
| s<sub>9</sub> &#x2261; 24 mod 32
| style="text-align:right" | 24, 56, 88, ...
|-
| s<sub>10</sub> &#x2261; 48 mod 64
| style="text-align:right" | 48, 112, 176, 240 ...
|-
| s<sub>11</sub> &#x2261; 16 mod 64
| style="text-align:right" | 16, 80, ...
|}
This shows that the columns s<sub>4</sub> ... s<sub>7</sub> contain all numbers &#x2261; 2,4,6,10,12,14 mod 16, but those &#x2261; 0,8 mod 16 are missing so far. The ones &#x2261; 8 mod 16  show up in s<sub>8</sub> resp. s<sub>9</sub>, half of the multiples of 16 are in s<sub>10</sub> resp. s<sub>11</sub> but &#x2261; 0,32 mod 64 are missing, etc.  


Since s<sub>2</sub> contains arbitray high powers of 3, S has rows of arbitrary length, and for the missing multiples of powers of 2 the exponents can be driven above all limits.
We find the following sequences in the columns of C:
: Thus S contains all positive integers.
<nowiki>C[i,2]</nowiki> = 24*(i - 1)  + 16
===Can S be generated starting at 1?===
<nowiki>C[i,3]</nowiki> = 24*(i - 1)/3 +  4   if i &#x2261; 1 mod 3 
We ask for an iterative process which starts with the row of S for index 1:
<nowiki>C[i,4]</nowiki> = 48*(i - 1)/3 + 10   if i &#x2261; 1 mod 3
  1:    3    1   2
  <nowiki>C[i,5]</nowiki> = 48*(i - 7)/9 + 34    if i &#x2261; 7 mod 9 
Then, all additional rows for the elements obtained so far are generated:
We thereby cover the highlighted numbers of the form 6*p - 2 &lt; 48:
  2:   7
'''4'''  '''10'''  '''16'''  22  '''28'''  '''34'''  '''40'''  46
  3:  11
These rows are also expanded:
  7:  27    9  18    6  12    4    8
  11:  43
Since we want to cover all indexes, we would first generate the rows for lower indexes. This process fills all rows up to s<sub>0</sub> = 13 rather quickly, but the first 27 completely filled rows involve start numbers s<sub>0</sub> up to 1539, and for the first 4831 rows, start values up to 4076811 are involved.

Revision as of 22:14, 18 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

Collatz Graph

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

  • always to n * 2, and
  • sometimes also to (n - 1) / 3.

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

The 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 cylces.

It is convenient to use abbreviations for the elementary operations which transform a node (element, number) x into y:

Name Mnemonic Distance to 4 Neighbour location Condition
x d y down -1 y = x / 2 x ≡ 0 mod 2
x u y up -1 y = 3 * x + 1 (none)
x δ y divide +1 y = (x - 1) / 3 x ≡ 1 mod 3
x µ y multiply +1 y = x * 2 (none)

When moving towards the root (4) of the graph, d/u operations are used, while δ/µ operations are used to move away from the root.

Detailed Segment Construction

We will now construct special portions of paths in the Collatz graph which we call segments. They lead away from the root, and they always start with a node x ≡ 4 mod 6. Then they split into a northern and a southern subsegment by applying the following operations:

  • northern: µ µ δ µ δ µ δ ...
  • southern: δ µ µ δ µ δ µ ...

The two subsegements are built in parallel, and the process is stopped when one of the two new nodes becomes divisible by 3, resp. when a δ operation is not possible.

We will call these segments detailled, and a segment directory can easily be created by a Perl program. We will later come back to more properties of detailed segments.

Compressed Segments

For the moment we will concentrate on the nodes x ≡ 4 mod 6 in the detailed segments (which are highlighted in the directory). For each segment we define a row i in an array C[i,j] as follows:

C[i,1] C[i,2] C[i,3] C[i,4] C[i,5] C[i,6] C[i,7] C[i,8] ...
6*i-2 C[i,1] µµ C[i,1] δµµ C[i,2] δµ C[i,3] δµ C[i,4] δµ C[i,5] δµ C[i,6] δµ ...

The row for the compressed segment is filled as long as the corresponding node in the detailed segment is ≡ 4 mod 6.

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

4 2 2 4 2 2 m 2 2 4 2 2 4 2 2 n 2 2 4 2 2 ...

with two fixed lengths 2 and 4 and some variable lengths m, n ... > 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).

If we interprete the C[i,j] as 6*p - 2, we observe that factors 3 in p are successively replaced by factors 2 for increasing j >= 2.

Connectivity of Segments

We now claim that all numbers of the form 6*p - 2 (C[i,1], the left side ) occur exactly once in the right side C[i,j], j > 1.

If this claim were proven, we could begin with the compressed segment for 4, and therein at every node > 4 we "attach" a unique segment with that starting element. Doing this iteratively we could reach all numbers of the form 6*p - 2.

We find the following sequences in the columns of C:

C[i,2] = 24*(i - 1)   + 16
C[i,3] = 24*(i - 1)/3 +  4    if i ≡ 1 mod 3  
C[i,4] = 48*(i - 1)/3 + 10    if i ≡ 1 mod 3  
C[i,5] = 48*(i - 7)/9 + 34    if i ≡ 7 mod 9  

We thereby cover the highlighted numbers of the form 6*p - 2 < 48:

4  10  16  22  28  34  40  46