The algorithmic structure of the finite stopping time behavior of the 3x+1 function

# The algorithmic structure of the finite stopping time behavior of the 3x+1 function

Mike Winkler
Fakultät für Mathematik
Ruhr-Universität Bochum, Germany
mike.winkler@ruhr-uni-bochum.de
November 26, 2017
###### Abstract

The problem concerns iteration of the map given by

The Conjecture states that every has some iterate . The least such that is called the stopping time of . It is shown that the residue classes of the integers with a finite stopping time can be evolved according to a directed rooted tree based on their parity vectors. Each parity vector represents a unique Diophantine equation whose only positive solutions are the integers with a finite stopping time. The tree structure is based on a precise algorithm which allows accurate statements about the solutions without solving the Diophantine equations explicitly. As a consequence, the integers with a finite stopping time can be generated algorithmically. It is also shown that the OEIS sequences A076227 and A100982 related to the residues can be generated algorithmically in a Pascal’s triangle-like manner from the two starting values 0 and 1. For the results no statistical and probability theoretical methods were used.

Mike Winkler - The algorithmic structure of the finite stopping time behavior of the function \cfoot\pagemark

Keywords and phrases: 3x + 1 problem, 3n + 1 conjecture, Collatz conjecture, Ulam conjecture, Kakutani’s problem, Thwaites conjecture, Hasse’s algorithm, Syracuse problem, hailstone sequence, finite stopping time, OEIS, A020914, A020915, A022921, A056576, A076227, A100982, A177789, A293308

Edits in this 3nd version: Shortened abstract, corrected typos on p.7, addition of A293308 on p.1 and p.9, corrected font for ”mod”, 2st version from Sep. 21, 2017.

## 1 Introduction

The function is defined as a function given by

 (1)

Let and for . Then we get for each a sequence .

For example the starting value generates the sequence

 C(11)=(11,17,26,13,20,10,5,8,4,2,1,2,1,2,1,…).

Any can only assume two possible forms. Either it falls into a cycle or it grows to infinity. The Conjecture states that every enters the trivial cycle .

## 2 The stopping time σ(x) and the residues (mod 2k)

The Conjecture holds if for each , there exists such that . The least such that is called the stopping time of , which we will denote by .

For the further text we define the following:

• Let , be a finite subsequence of .

• Let , be the number of odd terms in , whereby is not counted.

• Let for all .

It is not hard to verify that for specific residue classes of starting values only specific stopping times are possible which are determined by the real number .

Let , . Then generally applies for each that

 σ(x)=σnifx≡r1,r2,r3,…,rz (mod 2σn). (2)

For the first there is

if   ,
if   ,
if   ,
if   ,

and so forth. Appendix 9.2 shows the above list up to .

Let for each be the number of residue classes , respectively the number of congruences , as listed in A100982.

###### Theorem 1.

There exists for each a set of residue classes with the property that all integers of one of these residue classes have finite stopping time .

Proof. All essential references are given in the OEIS [5]. The possible stopping times are listed in A020914. The congruences of the associated residue classes are listed in A177789. But the proof of Theorem 2 is also a proof of Theorem 1.

Remarkably, as we shall see in the course of the next pages, the residue classes as mentioned in Theorem 1 can be generated algorithmically according to a directed rooted tree. (cf. Chapter 8)

###### Theorem 2.

For each the number of residue classes as listed in A100982 and the number of the remaining residue classes as listed in A076227 can be generated algorithmically in a Pascal’s triangle-like manner from the two starting values 0 and 1.

Proof. The residues can be evolved according to a binary tree. For the residues in each case, steps can be calculated. As long as a factor 2 is included, only the residue decides whether the next number is even or odd, and this step can be performed. If the powers of 2 are dissipated, they are replaced by a certain number of factors 3, which is less than or equal to the initial , depending on how many and steps have occurred.

Let , then in general leads to with . Whereby it is exactly for , which is also the deeper reason for the fact that more and more residues remain, specifically the residues of the form . If then the sequence can be sorted out, because the stopping time is reached.

If we now pass from a specific value to the value , always two new values arise from the remaining candidates, so became or . For one of them the result in the -th step is even, for the other it is odd. Which is what, we did not know before doubling the base, which is why we had to stop. And accordingly one continues with the step and thus to a value of the power of 3 increased by one, and the other with the step while maintaining the power of 3.

Now we consider the number of residues that lead to a specific power of 3. Let be the number of residues which meet the condition and lead to a residue . Each residue comes from a residue , and either is increased or is retained, depending on the type of step performed. Thus we have

 R(k+1,n)=R(k,n)+R(k,n−1) (3)

with the starting condition and . Because is the only non-trivial staring value and leads to . As a consequence, the number of residues can be calculated in a Pascal’s triangle-like manner or form, whose left side is cut off by the stopping time condition . The number of between and , as listed in A022921, we will denote by , is given by

 d(n)=⌊n⋅log23⌋−⌊(n−1)⋅log23⌋. (4)

The highest such that , as listed in A056576, we will denote by for each . Then with equation (4) it is

 κ(n)=n∑i=1d(i)=n∑i=1(⌊i⋅log23⌋−⌊(i−1)⋅log23⌋), (5)

and from the above definition of it follows also directly that

 κ(n)=⌊n⋅log23⌋. (6)

Further it is . Then with we get with is equivalent to

 κ(n+1)+1=σn. (7)

Equation (7) states that is the stopping time for for each , which completes the circle to (2) and Theorem 1. Remember that is the number of odd terms in , whereby is not counted. Therefore the stopping time for each is given exactly by of the highest such that or .

Back to the left sided bounding condition: For each the last value of equation (3) is given by

 k+1=κ(n). (8)

With the use of (3), (4), (5) and (8) now we are able to create an algorithm which generates A100982 and A076227 from the two starting values 0 and 1 for each .

Appendix 9.1.1 and 9.1.2 show a program for the algorithm of Theorem 2. Appendix 9.3 shows a detailed list for the expansion of the first residue classes .

Table 1 will make the algorithm of Theorem 2 more clear, no entry is equal to 0.

 d(n)= 1 2 1 2 1 2 2 1 2 1 2 ⋯ \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.0n= \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.01 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.02 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.03 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.04 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.05 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.06 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.07 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.08 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.09 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.010 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.011 \definecolor[named]pgfstrokecolorrgb0.0,0.5,0.0\pgfsys@color@rgb@stroke0.00.50.0\pgfsys@color@rgb@fill0.00.50.0⋯ \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.8k= \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.0w(k)= \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.82 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.01 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.83 1 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.02 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.84 2 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.03 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.85 3 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.04 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.86 3 4 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.08 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.87 7 5 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.013 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.88 12 6 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.019 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.89 12 18 7 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.038 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.810 30 25 8 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.064 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.811 30 55 33 9 1 \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.0128 \definecolor[named]pgfstrokecolorrgb0.6,0.0,0.8\pgfsys@color@rgb@stroke0.60.00.8\pgfsys@color@rgb@fill0.60.00.8⋮ ⋮ ⋮ ⋮ ⋮ ⋱ \definecolor[named]pgfstrokecolorrgb0.8,0.3,0.0\pgfsys@color@rgb@stroke0.80.30.0\pgfsys@color@rgb@fill0.80.30.0⋮ \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.0z(n)= \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.02 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.03 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.07 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.012 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.030 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.085 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.0173 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.0476 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.0961 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.02652 \definecolor[named]pgfstrokecolorrgb0.0,0.3,1.0\pgfsys@color@rgb@stroke0.00.31.0\pgfsys@color@rgb@fill0.00.31.0⋯

From Table 1 it can be seen that the sum of the values in each row is equal to the number of the surviving residues as listed in A076227, which we will denote by for each . Then there is

 w(k)=k∑n=⌊1+k⋅log32⌋R(k,n). (9)

The values for are listed in A020915. For example in the row for it can be seen that relating to there exist exactly remaining residues from which three lead to , four lead to and one leads to . The values with smaller powers of 3 are cut off by the condition .

The sum of the values in each column is equal to the number of residue classes as listed in A100982. With the use of equation (5) there is

 z(n)=κ(n)∑k=nR(k,n). (10)

For example in the column for it can be seen that there exists exactly residues classes which have stopping time .

The exact values for of the number of between and as listed in A022921 are given by the largest values in each column , precisely by and . For example in the column for the largest values are 3 for and . So, the powers of 2 existing between and are and . For the largest value is 7 for . Also exists only one power of 2 between and and that is .

## 3 Subsequences Cκ(n)(x) and a stopping time term formula for odd x

If an odd starting value has stopping time (cf. Theorem 1) then it is shown in the proof of Theorem 2 that for each the subsequence represents sufficiently the stopping time of . Because consists of odd terms and therefore all terms with are even.

If the succession of the even and odd terms in is known, it is quite easy to develop a formula for the exact value of with .

###### Theorem 3.

Given consisting of odd terms. Let , . Now let , if and only if in is odd. Then there is

 Tσn(x)=3n+12σn⋅x+n+1∑i=13n+1−i2αi2σn

Proof. With the use of Theorem 1 and 2, Theorem 3 follows almost directly from the function (1). A detailed proof is given by the author in an earlier article [14, pp.3-4,p.9]. A similar formula is also mentioned by Garner [2, p.2].

Example: For there is . Then for we get by equation (11)

 T7(59)=3427⋅59+3320+3221+3123+302427=38<59.

Explanation: For there is and consists of odd terms . The powers of two yield as follows: is odd, so . is odd, so . is even, so nothing happen. is odd, so . is odd, so . And a comparison with confirms the solution . Note that there is not only for , but also for every .

## 4 Parity vectors vn(x) and parity vector sets V(n) for each n≥1

To simplify the distribution of the even and odd terms in we define a zero-one sequence by

 vn(x)=Cκ(n)(x)withTs(x)=⎧⎪⎨⎪⎩0if \, Ts(x)≡0 (mod%  2),1if \, Ts(x)≡1 (mod 2), (12)

which we will denote as the parity vector of . In other words, is a vector of elements, where ”0” represents an even term and ”1” represents an odd term in . And for each we will define the parity vector set as the set of parity vectors , whereby for each parity vector of the set. (cf. Theorem 1)

Example: For there is . Then for , and the subsequences and its appropriate parity vectors are

 C4(7) =(7,11,17,26,13)has parity vector v3(7) =(1,1,1,0,1), C4(15) =(15,23,35,53,80)has parity vector v3(15) =(1,1,1,1,0), C4(59) =(59,89,134,67,101)has parity vector v3(59) =(1,1,0,1,1).

The parity vector set then consists of these three parity vectors, because for there is only for the