Preprint
Article

Solve the 3x+1 Problem by the Multiplication and Division of Binary Numbers

Altmetrics

Downloads

440

Views

206

Comments

1

This version is not peer-reviewed

Submitted:

14 February 2023

Posted:

20 February 2023

You are already at the latest version

Alerts
Abstract
The 3x+1 problem asks the following: Suppose we start with a positive integer, and if it is odd then multiply it by 3 and add 1, and if it is even, divide it by 2. Then repeat this process as long as you can. Do you eventually reach the integer 1, no matter what you started with? Collatz conjecture (or 3n+1 problem) has been explored for about 85 years. In this paper, we convert an integer number from decimal to binary number, and convert the Collatz function to binary function, which is multiplication and division of two binary numbers. Finally the iternation of the Collatz function, eventually reach the integer 1, thus we solve the 3x+1 problem completely.
Keywords: 
Subject: Computer Science and Mathematics  -   Algebra and Number Theory

1. Introduction

The 3 x + 1 problem, also known as the Collatz conjecture, 3 x + 1 mapping, Ulam conjecture, Kakutani’s problem, Thwaites conjecture, Hasse’s algorithm, or Syracuse problem [1], is one of the unsolved problems in mathematics. Paul Erdos (1913-1996) commented on the intractability of the 3 x + 1 problem [2], stating that "Mathematics is not ready for those problems yet".
The 2 x + 1 problem states that, for any positive integer x, if x is even, divide it by 2; if x is odd, multiply it by 3 and add 1. Repeating this process continuously leads to the conjecture that no matter which number is initially chosen, the result will always reach 1 eventually.

2. Terminology and notations

We use the notations as in [4,7], and describe a Collatz function as follows:
T ( n ) = 3 n + 1 , if n is odd number , n 2 if n is even number .
Let N denote the set of positive integers. For n N , and k = 0 , 1 , 2 , 3 , , T 0 ( n ) and T k + 1 ( n ) denote n and T ( T k ( n ) , respectively. Concerning the behavior of the iteration of the Collatz function, for any integer n, there must exist an integer r so that
T r ( n ) = 1 .

2.1. The modified Sarkovskii ordering and integer lattice

We convert the last row of numbers into the first column to get a modified Sarkovskii ordered integer lattice[6] as the following,
1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 2 , 2 · 3 , 2 · 5 , 2 · 7 , 2 · 9 , 2 · 11 , 2 · 13 , 2 · 15 , 2 · 17 , 2 · 19 , 2 2 , 2 2 · 3 , 2 2 · 5 , 2 2 · 7 , 2 2 · 9 , 2 2 · 11 , 2 2 · 13 , 2 2 · 15 , 2 2 · 17 , 2 2 · 19 , 2 3 , 2 3 · 3 , 2 3 · 5 , 2 3 · 7 , 2 3 · 9 , 2 3 · 11 , 2 3 · 13 , 2 3 · 15 , 2 3 · 17 , 2 3 · 19 , 2 4 , 2 4 · 3 , 2 4 · 5 , 2 4 · 7 , 2 4 · 9 , 2 4 · 11 , 2 4 · 13 , 2 4 · 15 , 2 4 · 17 , 2 4 · 19 ,
In the first row, they are odd numbers from left to right, that are 1 , 3 , 5 , 7 , 9 , 11 , 13 , . From the second row, each number is two times the number in its previous row, and so on.

2.2. The algebraic formula and Collatz graph

If we draw a line segment with an arrow between two digits in the lattice of integers in the modified Sarkovskii ordering, one being the original value x and the other being its value of the Collatz function T ( x ) , and then connect T ( x ) to T 2 ( x ) , and so on T 2 ( x ) to T 3 ( x ) , , we get a graph which can be called a Collatz graph.
For different integers k and l, if there is a common vertex in their Collatz graphs, their graphs will overlap from that point onwards until they reach the minimum value of 1. Using the Collatz function T ( x ) , we can obtain an algebraic formula of 1 2 4 , 3 2 7 , 3 2 2 9 , , 3 m 2 r · x , where r is the number of vertical segments and m is the number of oblique segments in the Collatz graph,
T m + r ( n ) = T ( m , r , n ) = 1 2 4 + 3 2 7 + 3 2 2 9 + + 3 m 2 r · x = 1 .
For example, n = 7 , 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 , the algebraic formula is
T 16 ( 7 ) = T ( 5 , 11 , 7 ) = 1 2 4 + 3 2 7 + 3 2 2 9 + 3 3 2 10 + 3 4 2 11 + 3 5 2 11 · 7 = 1 ,
and the Collatz graph is Figure 1.
And n = 36 , 36 18 9 28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 , the algebraic formula is
T 21 ( 36 ) = T ( 6 , 15 , 36 ) = 1 2 4 + 3 2 7 + 3 2 2 9 + 3 3 2 10 + 3 4 2 11 + 3 5 2 13 + 3 6 2 15 · 36 = 1
and the Collatz graph is Figure 2.
We observe that there is a property present,
Proposition 1.
For positive integers i , j , k , l , and l k , l k 1 , , l 1 , if i > j , then there is a recurrence relation
T i ( n ) = 3 k 2 l T j ( n ) + 3 k 1 2 l k + + 3 2 2 l 3 + 3 2 l 2 + 1 2 l 1
where k + l = i j , and l l k l k 1 l 1 .
For example, there are
T 3 ( 97 ) = 3 2 2 · 97 + 1 2 2 = 73
T 18 ( 97 ) = 3 7 2 11 · 97 + 3 6 2 11 + 3 5 2 9 + 3 4 2 7 + 3 3 2 6 + 3 2 2 5 + 3 2 2 + 1 2 = 107
We can get the recurrence formula about the Collatz function,
T 26 ( 97 ) = 3 3 2 5 · T 18 ( 97 ) + 3 2 2 5 + 3 2 4 + 1 2 2 = 3 10 2 16 · 97 + 3 9 2 16 + 3 8 2 14 + 3 7 2 12 + 3 6 2 11 + 3 5 2 10 + 3 4 2 7 + 3 3 2 6 + 3 2 2 5 + 3 2 4 + 1 2 2 = 91 ,

3. Numerical example

Using the above Collatz graphs of the integer lattice of the modified Sarkovskii ordering, we give the following algebraic formulas,
T 19 ( 9 ) = T ( 6 , 13 , 9 ) = 1 2 4 + 3 2 7 + 3 2 2 9 + 3 3 2 10 + 3 4 2 11 + 3 5 2 13 + 3 6 2 13 · 9 = 1 ,
T 15 ( 23 ) = T ( 4 , 11 , 23 ) = 1 2 4 + 3 2 9 + 3 2 2 10 + 3 3 2 11 + 3 4 2 11 · 23 = 1 ,
T 17 ( 15 ) = T ( 5 , 12 , 15 ) = 1 2 4 + 3 2 9 + 3 2 2 10 + 3 3 2 11 + 3 4 2 12 + 3 5 2 12 · 15 = 1 ,
T 12 ( 17 ) = T ( 3 , 9 , 17 ) = 1 2 4 + 3 2 7 + 3 2 2 9 + 3 3 2 9 · 17 = 1 ,
T 19 ( 61 ) = T ( 5 , 14 , 61 ) = 1 2 4 + 3 2 9 + 3 2 2 10 + 3 3 2 11 + 3 4 2 14 + 3 5 2 14 · 61 = 1 .
T 16 ( 397 ) = T ( 5 , 11 , 397 ) = 1 2 4 + 3 2 7 + 3 2 2 9 + 3 3 2 10 + 3 4 2 11 + 3 5 2 17 + 3 6 2 20 + 3 7 2 20 · 397 = 1 ,
Example 2.
For the formula
T ( 6 , 14 , 18 ) = 1 2 4 + 3 2 7 + 3 2 2 9 + 3 3 2 10 + 3 4 2 11 + 3 5 2 13 + 3 6 2 14 · 18 = 1 ,
we rewrite it as an integer equation,
3 6 · 18 + 3 5 · 2 + 3 4 · 2 3 + 3 3 · 2 4 + 3 2 · 2 5 + 3 · 2 7 + 2 10 = 2 14 .
Proof. 
To calculate the power of 3 and the value of 18 using powers of 2,
3 = 2 + 1 3 2 = 2 3 + 1 3 3 = 2 4 + 2 3 + 2 + 1 3 4 = 2 6 + 2 4 + 1 3 5 = 2 7 + 2 6 + 2 5 + 2 4 + 2 + 1 3 6 = 2 9 + 2 7 + 2 6 + 2 4 + 2 3 + 1 18 = 2 4 + 2
substituting these expressions into the left-hand side of the above equation, one obtains,
3 6 · 18 + 3 5 · 2 + 3 4 · 2 3 + 3 3 · 2 4 + 3 2 · 2 5 + 3 · 2 7 + 2 10 = ( 2 9 + 2 7 + 2 6 + 2 4 + 2 3 + 1 ) · ( 2 4 + 2 ) + ( 2 7 + 2 6 + 2 5 + 2 4 + 2 + 1 ) · 2 + ( 2 6 + 2 4 + 1 ) · 2 3 + ( 2 4 + 2 3 + 2 + 1 ) · 2 4 + ( 2 3 + 1 ) · 2 5 + ( 2 + 1 ) · 2 7 + 2 10 ,
and get the value 2 14 which is equal to the right value of the equation. □

4. Convert the integer number from decimal to binary

Be inspired by the above, we use binary to rewrite the Collatz function (1) as the following formulas (2) and (3). We denote a binary number, which is a string of 0s and 1s, as n = ( 1 × × ) 2 , where × is either 1 or 0, e.g. 3 = ( 11 ) 2 ,
T ( n ) = T ( ( 1 × × ) 2 ) = ( 11 ) 2 · ( 1 × × 1 ) 2 + 1 , if n is odd number , ( 1 × × 10 00 ) 2 ( 10 ) 2 , if n is even number .
The result is
T ( n ) = T ( ( 1 × × ) 2 ) = ( 1 × × × 10 0 ) 2 , if n is odd number , ( 1 × × 10 0 ) 2 , if n is even number .
Namely, when n is an odd number, we multiply it with (11)2 and add 1 to the end of the binary number. For example, T ( 97 ) = T ( 1100001 ) in Figure 3. When n is an even number, the division is equal to deleting the zero at the end in the binary number. We give the iteration of the Collatz function for 1 , 5 , 7 , 9 , 97 in binary as the following five tables.
Example 3.
For positive integer 1, we manipulate the iteration of the Collatz function in both decimal and binary numbers,
l l l l l i t h 0 1 2 3 d e c i m a l 1 4 2 1 b i n a r y 1 100 10 1
Example 4.
For positive integer 5 = ( 101 ) 2 , we manipulate the iteration of the Collatz function in both decimal and binary numbers,
i t h 0 1 2 3 4 5 d e c i m a l 5 16 8 4 2 1 b i n a r y 101 10000 1000 100 10 1
Example 5.
For 7 = ( 111 ) 2 , we manipulate the iteration of the Collatz function in both decimal and binary numbers.
i t h 0 1 2 3 4 5 7 8 11 12 16 d e c i m a l 7 22 11 34 17 52 13 40 5 16 1 b i n a r y 111 10110 1011 100010 10001 110100 1101 101000 101 10000 1
Example 6.
For 9 = ( 1001 ) 2 , we manipulate the iteration of the Collatz function in both decimal and binary numbers.
i t h 0 1 2 3 4 5 6 7 14 15 19 d e c i m a l 9 28 14 7 22 11 34 17 5 16 1 b i n a r y 1001 11100 1110 111 10110 1011 100010 10001 101 10000 1
Example 7.
For 97 = ( 100100 ) 2 , we manipulate the iteration of the Collatz function in binary as the following table,
Preprints 68647 i001
Corollary 8.
The Collatz function makes an odd integer number in binary bigger by adding 1 or 2 bits to the left of the sequence of 1s and 0s, and an even integer number in binary smaller by deleting all zeros at the end of the sequence of 1s and 0s. Thus, although in some cases the value of The Collatz function T(x) may be bigger than x in decimal, in general, the iteration of the Collatz function will make an integer number smaller and smaller, eventually reaching the smallest positive integer number 1.
We can rewrite the Collatz conjecture in binary, which makes it an easier problem to solve, thus allowing us to completely solve the Collatz conjecture.
Fact 9.
For any positive integer, under the Collatz function, the sequence of integer numbers in binary will eventually reach 1.
Proof. 
For an odd binary integer, we multiply it by (11)2 and add 1 in the last bit, the result number must be an even number in binary which at least one zero at the end. We delete all these zeros, namely it is the division. This is the above corollary 8. Thus, we repeat this process as long as we can, because the bits of the sequence in binary of a positive integer number is finite. Eventually, we must in finitely steps reach the smallest positive integer number 1. □
Remark 10.
We can say that the 3x+1 problem is a converse proposition of "period three implies chaos" [4], and it is also an example of any one positive integer number having a period of 3 in the Collatz function.

5. Conclusions

We rewrite the Collatz function in binary, which makes the 3 x + 1 problem easier. The multiplications of (11)2 and divisions of (10)2 make the positive integer number smaller and smaller with the iterations of the Collatz function. In some cases, the value of the Collatz function T ( x ) may be bigger than x, thus allowing us to completely solve the Collatz conjecture.

References

  1. Jeffrey, C. Lagarias. The 3x + 1 Problem and Its Generalizations. American Mathematical Monthly, Vol. 92, No. 1, pp 3-23.(1985).
  2. Jeffrey, C. Lagarias. The 3x+1 Problem: An Overview, arXiv:2111.02635.
  3. Stefan, P. A Theorem of Sarkovshii on the existence of periodic orbits of continuous endomorphisms of the real line. Commun. math. Phys. 54,237-248(1977).
  4. Li, T. , Yorke, J. A. Period three implies chaos. Am. Mat. Monthly, 82, 985–992 (1975).
  5. TERENCE TAO, Almost all orbits of the Collatz map attain almost bounded values. arXiv:1909.03562v5, 2022,1,15. arXiv:1909.03562v5, 2022,1,15.
  6. Jishe FENG, Xiaomeng WANG, Xiaolu GAO, Zhuo PAN. The research and progress of the enumeration of lattice paths. Frontiers of Mathematics in China, 2022, 17(5): 747-766.
  7. Alf Kimms. The structure of the 3x+1 problem, Electronic Journal of Graph Theory and Applications, 9(1)(2021),157–174.
Figure 1. The Collatz graph of T 16 ( 7 ) = T ( 5 , 11 , 7 ) = 1 in the lattice of integers in the modified Sarkovskii ordering and the algebraic formula.
Figure 1. The Collatz graph of T 16 ( 7 ) = T ( 5 , 11 , 7 ) = 1 in the lattice of integers in the modified Sarkovskii ordering and the algebraic formula.
Preprints 68647 g001
Figure 2. The Collatz graph of T 21 ( 36 ) = T ( 6 , 15 , 36 ) = 1 in the lattice of integers in the modified Sarkovskii ordering and the algebraic formula.
Figure 2. The Collatz graph of T 21 ( 36 ) = T ( 6 , 15 , 36 ) = 1 in the lattice of integers in the modified Sarkovskii ordering and the algebraic formula.
Preprints 68647 g002
Figure 3. For the Collatz function T ( 97 ) in binary, the first step is the multiplication in left, the second step is division in the right bottom.
Figure 3. For the Collatz function T ( 97 ) in binary, the first step is the multiplication in left, the second step is division in the right bottom.
Preprints 68647 g003
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2024 MDPI (Basel, Switzerland) unless otherwise stated