Collatz conjecture
{{short description|Open problem on 3x+1 and x/2 functions}}
{{pp|small=yes}}
{{unsolved|mathematics|{{bulleted list|For even numbers, divide by 2;|For odd numbers, multiply by 3 and add 1.}}With enough repetition, do all positive integers converge to 1?}}
File:Collatz-graph-50-no27.svg showing the orbits of small numbers under the Collatz map, skipping even numbers. The Collatz conjecture states that all paths eventually lead to 1.]]
The Collatz conjecture{{efn|It is also known as the {{math|3n + 1}} problem (or conjecture), the {{math|3x + 1}} problem (or conjecture), the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Bryan Thwaites), Hasse's algorithm (after Helmut Hasse), or the Syracuse problem (after Syracuse University).{{cite book |last1=Maddux |first1=Cleborne D. |last2=Johnson |first2=D. Lamont |year=1997 |title=Logo: A Retrospective |publisher=Haworth Press |location=New York |isbn=0-7890-0374-0 |page=160 |quote=The problem is also known by several other names, including: Ulam's conjecture, the Hailstone problem, the Syracuse problem, Kakutani's problem, Hasse's algorithm, and the Collatz problem.}}{{refn|According to {{named ref|name=Lagarias (1985)}} p. 4, the name "Syracuse problem" was proposed by Hasse in the 1950s, during a visit to Syracuse University.}}}} is one of the most famous unsolved problems in mathematics. The conjecture asks whether repeating two simple arithmetic operations will eventually transform every positive integer into 1. It concerns sequences of integers in which each term is obtained from the previous term as follows: if a term is even, the next term is one half of it. If a term is odd, the next term is 3 times the previous term plus 1. The conjecture is that these sequences always reach 1, no matter which positive integer is chosen to start the sequence. The conjecture has been shown to hold for all positive integers up to {{val|2.36e21}}, but no general proof has been found.
It is named after the mathematician Lothar Collatz, who introduced the idea in 1937, two years after receiving his doctorate.{{mactutor|title=Lothar Collatz|id=Collatz}} The sequence of numbers involved is sometimes referred to as the hailstone sequence, hailstone numbers or hailstone numerals (because the values are usually subject to multiple descents and ascents like hailstones in a cloud),{{cite book |last=Pickover |first=Clifford A. |year=2001 |title=Wonders of Numbers |url=https://archive.org/details/wondersnumbersad00pick |url-access=limited |publisher=Oxford University Press |location=Oxford |isbn=0-19-513342-0 |pages=[https://archive.org/details/wondersnumbersad00pick/page/n136 116]–118}} or as wondrous numbers.{{cite book |last=Hofstadter |first=Douglas R. |author-link=Douglas Hofstadter |year=1979 |title=Gödel, Escher, Bach |publisher=Basic Books |location=New York |isbn=0-465-02685-0 |pages=[https://archive.org/details/godelescherbach00doug/page/400 400–2]|title-link=Gödel, Escher, Bach }}
Paul Erdős said about the Collatz conjecture: "Mathematics may not be ready for such problems." Jeffrey Lagarias stated in 2010 that the Collatz conjecture "is an extraordinarily difficult problem, completely out of reach of present day mathematics". However, though the Collatz conjecture itself remains open, efforts to solve the problem have led to new techniques and many partial results.{{Cite journal |last=Tao |first=Terence |date=2022 |title=Almost all orbits of the Collatz map attain almost bounded values |journal=Forum of Mathematics, Pi |language=en |volume=10 |pages=e12 |doi=10.1017/fmp.2022.8 |issn=2050-5086|doi-access=free |arxiv=1909.03562 }}
Statement of the problem
File:Collatz-stopping-time.svg
File:CollatzStatistic100million.png
File:CollatzStatistic1billion.png
Consider the following operation on an arbitrary positive integer:
- If the number is even, divide it by two.
- If the number is odd, triple it and add one.
In modular arithmetic notation, define the function {{mvar|f}} as follows:
3n+1 & \text{if } n\equiv 1 \pmod{2} .\end{cases}
Now form a sequence by performing this operation repeatedly, beginning with any positive integer, and taking the result at each step as the input at the next.
In notation:
(that is: {{math|ai}} is the value of {{mvar|f}} applied to {{mvar|n}} recursively {{mvar|i}} times; {{math|ai {{=}} f{{hsp}}{{isup|i}}(n)}}).
The Collatz conjecture is: This process will eventually reach the number 1, regardless of which positive integer is chosen initially. That is, for each , there is some with .
If the conjecture is false, it can only be because there is some starting number which gives rise to a sequence that does not contain 1. Such a sequence would either enter a repeating cycle that excludes 1, or increase without bound. No such sequence has been found.
The smallest {{mvar|i}} such that {{math|ai < a0 }} is called the stopping time of {{mvar|n}}. Similarly, the smallest {{mvar|k}} such that {{math|ak {{=}} 1}} is called the total stopping time of {{mvar|n}}. If one of the indexes {{mvar|i}} or {{mvar|k}} doesn't exist, we say that the stopping time or the total stopping time, respectively, is infinite.
The Collatz conjecture asserts that the total stopping time of every {{mvar|n}} is finite. It is also equivalent to saying that every {{math|n ≥ 2}} has a finite stopping time.
Since {{math|3n + 1}} is even whenever {{mvar|n}} is odd, one may instead use the "shortcut" form of the Collatz function:
This definition yields smaller values for the stopping time and total stopping time without changing the overall dynamics of the process.
Empirical data
For instance, starting with {{math|n {{=}} 12}} and applying the function {{math|f}} without "shortcut", one gets the sequence {{CSG|12}}.
The number {{math|n {{=}} 19}} takes longer to reach 1: {{CSG|19}}.
The sequence for {{math|n {{=}} 27}}, listed and graphed below, takes 111 steps (41 steps through odd numbers, in bold), climbing as high as 9232 before descending to 1.
: {{CSG|27|bold= odd}}{{OEIS|id=A008884}}
Numbers with a total stopping time longer than that of any smaller starting value form a sequence beginning with:
:1, 2, 3, 6, 7, 9, 18, 25, 27, 54, 73, 97, 129, 171, 231, 313, 327, 649, 703, 871, 1161, 2223, 2463, 2919, 3711, 6171, ... {{OEIS|A006877}}.
The starting values whose maximum trajectory point is greater than that of any smaller starting value are as follows:
:1, 2, 3, 7, 15, 27, 255, 447, 639, 703, 1819, 4255, 4591, 9663, 20895, 26623, 31911, 60975, 77671, 113383, 138367, 159487, 270271, 665215, 704511, ... {{OEIS|id=A006884}}
Number of steps for {{mvar|n}} to reach 1 are
:0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 9, 17, 17, 4, 12, 20, 20, 7, 7, 15, 15, 10, 23, 10, 111, 18, 18, 18, 106, 5, 26, 13, 13, 21, 21, 21, 34, 8, 109, 8, 29, 16, 16, 16, 104, 11, 24, 24, ... {{OEIS|id=A006577}}
The starting value having the largest total stopping time while being
:less than 10 is 9, which has 19 steps,
:less than 100 is 97, which has 118 steps,
:less than 1000 is 871, which has 178 steps,
:less than 104 is 6171, which has 261 steps,
:less than 105 is {{val|77031}}, which has 350 steps,
:less than 106 is {{val|837799}}, which has 524 steps,
:less than 107 is {{val|8400511}}, which has 685 steps,
:less than 108 is {{val|63728127}}, which has 949 steps,
:less than 109 is {{val|670617279}}, which has 986 steps,
:less than 1010 is {{val|9780657630}}, which has 1132 steps,{{cite journal |last1=Leavens |first1=Gary T. |last2=Vermeulen |first2=Mike |date=December 1992 |title=3x + 1 search programs |journal=Computers & Mathematics with Applications |volume=24 |issue=11 |pages=79–99 |doi=10.1016/0898-1221(92)90034-F|doi-access= }}
:less than 1011 is {{val|75128138247}}, which has 1228 steps,
:less than 1012 is {{val|989345275647}}, which has 1348 steps.{{cite web |last=Roosendaal |first=Eric |title=3x+1 delay records |url=http://www.ericr.nl/wondrous/delrecs.html |access-date=14 March 2020}} (Note: "Delay records" are total stopping time records.) {{OEIS|id=A284668}}
These numbers are the lowest ones with the indicated step count, but not necessarily the only ones below the given limit. As an example, {{val|9780657631}} has 1132 steps, as does {{val|9780657630}}.
The starting values having the smallest total stopping time with respect to their number of digits (in base 2) are the powers of two, since {{math|2n}} is halved {{mvar|n}} times to reach 1, and it is never increased.
Visualizations
File:Collatz orbits of the all integers up to 1000.svg|Directed graph showing the orbits of the first 1000 numbers.
File:CollatzConjectureGraphMaxValues.jpg|The {{mvar|x}} axis represents starting number, the {{mvar|y}} axis represents the highest number reached during the chain to 1. This plot shows a restricted {{mvar|y}} axis: some {{mvar|x}} values produce intermediates as high as {{val|2.7e7}} (for {{math|x {{=}} 9663}})
File:Collatz-max.png|The same plot as the previous one but on log scale, so all {{mvar|y}} values are shown. The first thick line towards the middle of the plot corresponds to the tip at 27, which reaches a maximum at 9232.
File:All Collatz sequences of a length inferior to 20.svg|The tree of all the numbers having fewer than 20 steps.
File:Collatz Conjecture 100M.jpg|alt=Collatz Conjecture 100M|The number of iterations it takes to get to one for the first 100 million numbers.
File:Collatz_conjecture_tree_visualization.png|Collatz conjecture paths for 5000 random starting points below 1 million.
Supporting arguments
Although the conjecture has not been proven, most mathematicians{{Citation needed|date=April 2025}} who have looked into the problem think the conjecture is true because experimental evidence and heuristic arguments support it.
=Experimental evidence=
The conjecture has been checked by computer for all starting values up to 271 ≈ {{val|2.36e21}}. All values tested so far converge to 1.{{cite journal | last = Barina | first = David | title = Improved verification limit for the convergence of the Collatz conjecture | journal = The Journal of Supercomputing | year = 2025 | volume = 81 | issue = 810 | pages = 1–14 | doi = 10.1007/s11227-025-07337-0 | s2cid = 220294340 |url=https://link.springer.com/content/pdf/10.1007/s11227-025-07337-0.pdf }}
This computer evidence is still not rigorous proof that the conjecture is true for all starting values, as counterexamples may be found when considering very large (or possibly immense) positive integers, as in the case of the disproven Pólya conjecture and Mertens conjecture.
However, such verifications may have other implications. Certain constraints on any non-trivial cycle, such as lower bounds on the length of the cycle, can be proven based on the value of the lowest term in the cycle. Therefore, computer searches to rule out cycles that have a small lowest term can strengthen these constraints.
=A probabilistic heuristic=
If one considers only the odd numbers in the sequence generated by the Collatz process, then each odd number is on average {{sfrac|3|4}} of the previous one.{{refn|{{named ref|name=Lagarias (1985)}} section "[http://www.cecm.sfu.ca/organics/papers/lagarias/paper/html/node3.html A heuristic argument"].}} (More precisely, the geometric mean of the ratios of outcomes is {{sfrac|3|4}}.) This yields a heuristic argument that every Hailstone sequence should decrease in the long run, although this is not evidence against other cycles, only against divergence. The argument is not a proof because it assumes that Hailstone sequences are assembled from uncorrelated probabilistic events. (It does rigorously establish that the 2-adic extension of the Collatz process has two division steps for every multiplication step for almost all 2-adic starting values.)
=Stopping times=
As proven by Riho Terras, almost every positive integer has a finite stopping time. In other words, almost every Collatz sequence reaches a point that is strictly below its initial value. The proof is based on the distribution of parity vectors and uses the central limit theorem.
In 2019, Terence Tao improved this result by showing, using logarithmic density, that almost all (in the sense of logarithmic density) Collatz orbits are descending below any given function of the starting point, provided that this function diverges to infinity, no matter how slowly. Responding to this work, Quanta Magazine wrote that Tao "came away with one of the most significant results on the Collatz conjecture in decades".{{Cite web |last=Hartnett |first=Kevin |date=December 11, 2019 |title=Mathematician Proves Huge Result on 'Dangerous' Problem |url=https://www.quantamagazine.org/mathematician-proves-huge-result-on-dangerous-problem-20191211/ |website=Quanta Magazine}}
=Lower bounds=
In a computer-aided proof, Krasikov and Lagarias showed that the number of integers in the interval {{math|[1,x]}} that eventually reach 1 is at least equal to {{math|x0.84}} for all sufficiently large {{mvar|x}}.{{Cite journal
| last1 = Krasikov | first1 = Ilia
| last2 = Lagarias | first2 = Jeffrey C. | author-link2 = Jeffrey Lagarias
| year = 2003
| title = Bounds for the 3x + 1 problem using difference inequalities
| journal = Acta Arithmetica
| url = https://www.impan.pl/download/pdf/aa109-3-4
| doi = 10.4064/aa109-3-4
| mr = 1980260
| volume = 109
| issue = 3
| pages = 237–258| arxiv = math/0205002
| bibcode = 2003AcAri.109..237K
| s2cid = 18467460
}}
Cycles
In this part, consider the shortcut form of the Collatz function
A cycle is a sequence {{math|(a0, a1, ..., aq)}} of distinct positive integers where {{math|f(a0) {{=}} a1}}, {{math|f(a1) {{=}} a2}}, ..., and {{math|f(aq) {{=}} a0}}.
The only known cycle is {{math|(1,2)}} of period 2, called the trivial cycle.
=Cycle length=
The length of a non-trivial cycle is known to be at least {{val|114208327604}} (or {{val|186265759595}} without shortcut). If it can be shown that for all positive integers less than the Collatz sequences reach 1, then this bound would raise to {{val|217976794617}} ({{val|355504839929}} without shortcut). In fact, Eliahou (1993) proved that the period {{mvar|p}} of any non-trivial cycle is of the form
where {{mvar|a}}, {{mvar|b}} and {{mvar|c}} are non-negative integers, {{math|b ≥ 1}} and {{math|1=ac = 0}}. This result is based on the simple continued fraction expansion of {{math|{{sfrac|ln 3|ln 2}}}}.
={{mvar|k}}-cycles=
A {{mvar|k}}-cycle is a cycle that can be partitioned into {{math|k}} contiguous subsequences, each consisting of an increasing sequence of odd numbers, followed by a decreasing sequence of even numbers. For instance, if the cycle consists of a single increasing sequence of odd numbers followed by a decreasing sequence of even numbers, it is called a 1-cycle.
Steiner (1977) proved that there is no 1-cycle other than the trivial {{math|(1; 2)}}. Simons (2005) used Steiner's method to prove that there is no 2-cycle.{{cite journal |last=Simons |first=John L. |year=2005 |title=On the nonexistence of 2-cycles for the 3x + 1 problem |journal=Math. Comp. |volume=74 |pages=1565–72 |mr=2137019 |doi=10.1090/s0025-5718-04-01728-4|bibcode=2005MaCom..74.1565S |doi-access=free }} Simons and de Weger (2005) extended this proof up to 68-cycles; there is no {{mvar|k}}-cycle up to {{math|k {{=}} 68}}. Hercher extended the method further and proved that there exists no k-cycle with {{math|k ≤ 91}}. As exhaustive computer searches continue, larger {{math|k}} values may be ruled out. To state the argument more intuitively; we do not have to search for cycles that have less than 92 subsequences, where each subsequence consists of consecutive ups followed by consecutive downs.{{clarify|date=September 2024}}
Other formulations of the conjecture
=In reverse=
File:Collatz-tree, depth=20.svg generated in bottom-up fashion. The graph includes all numbers with an orbit length of 21 or less.]]
There is another approach to prove the conjecture, which considers the bottom-up
method of growing the so-called Collatz graph. The Collatz graph is a graph defined by the inverse relation
So, instead of proving that all positive integers eventually lead to 1, we can try to prove that 1 leads backwards to all positive integers. For any integer {{mvar|n}}, {{math|n ≡ 1 (mod 2)}} if and only if {{math|3n + 1 ≡ 4 (mod 6)}}. Equivalently, {{math|{{sfrac|n − 1|3}} ≡ 1 (mod 2)}} if and only if {{math|n ≡ 4 (mod 6)}}. Conjecturally, this inverse relation forms a tree except for the 1–2–4 loop (the inverse of the 4–2–1 loop of the unaltered function {{mvar|f}} defined in the Statement of the problem section of this article).
When the relation {{math|3n + 1}} of the function {{mvar|f}} is replaced by the common substitute "shortcut" relation {{math|{{sfrac|3n + 1|2}}}}, the Collatz graph is defined by the inverse relation,
For any integer {{mvar|n}}, {{math|n ≡ 1 (mod 2)}} if and only if {{math|{{sfrac|3n + 1|2}} ≡ 2 (mod 3)}}. Equivalently, {{math|{{sfrac|2n − 1|3}} ≡ 1 (mod 2)}} if and only if {{math|n ≡ 2 (mod 3)}}. Conjecturally, this inverse relation forms a tree except for a 1–2 loop (the inverse of the 1–2 loop of the function f(n) revised as indicated above).
Alternatively, replace the {{math|3n + 1}} with {{math|{{sfrac|n{{prime}}|H(n{{prime}})}}}} where {{math|n{{prime}} {{=}} 3n + 1}} and {{math|H(n{{prime}})}} is the highest power of 2 that divides {{math|n{{prime}}}} (with no remainder). The resulting function {{mvar|f}} maps from odd numbers to odd numbers. Now suppose that for some odd number {{mvar|n}}, applying this operation {{mvar|k}} times yields the number 1 (that is, {{math|f{{isup|k}}(n) {{=}} 1}}). Then in binary, the number {{mvar|n}} can be written as the concatenation of strings {{math|wk wk−1 ... w1}} where each {{math|wh}} is a finite and contiguous extract from the representation of {{math|{{sfrac|1|3h}}}}.{{cite journal |last=Colussi |first=Livio |date=9 September 2011 |title=The convergence classes of Collatz function |journal=Theoretical Computer Science |doi=10.1016/j.tcs.2011.05.056 |volume=412 |issue=39 |pages=5409–5419|doi-access=free }} The representation of {{mvar|n}} therefore holds the repetends of {{math|{{sfrac|1|3h}}}}, where each repetend is optionally rotated and then replicated up to a finite number of bits. It is only in binary that this occurs.{{cite journal |last=Hew |first=Patrick Chisan |date=7 March 2016 |title=Working in binary protects the repetends of 1/3h: Comment on Colussi's 'The convergence classes of Collatz function' |journal=Theoretical Computer Science |doi=10.1016/j.tcs.2015.12.033 |volume=618 |pages=135–141|doi-access=free }} Conjecturally, every binary string {{mvar|s}} that ends with a '1' can be reached by a representation of this form (where we may add or delete leading '0's to {{mvar|s}}).
=As an abstract machine that computes in base two=
Repeated applications of the Collatz function can be represented as an abstract machine that handles strings of bits. The machine will perform the following three steps on any odd number until only one {{mono|1}} remains:
- Append {{mono|1}} to the (right) end of the number in binary (giving {{math|2n + 1}});
- Add this to the original number by binary addition (giving {{math|2n + 1 + n {{=}} 3n + 1}});
- Remove all trailing {{mono|0}}s (that is, repeatedly divide by 2 until the result is odd).
==Example==
The starting number 7 is written in base two as {{mono|111}}. The resulting Collatz sequence is:
111
1111
10110
10111
100010
100011
110100
11011
101000
1011
10000
=As a parity sequence=
For this section, consider the shortcut form of the Collatz function
If {{math|P(...)}} is the parity of a number, that is {{math|P(2n) {{=}} 0}} and {{math|P(2n + 1) {{=}} 1}}, then we can define the Collatz parity sequence (or parity vector) for a number {{mvar|n}} as {{math|pi {{=}} P(ai)}}, where {{math|a0 {{=}} n}}, and {{math|ai+1 {{=}} f(ai)}}.
Which operation is performed, {{math|{{sfrac|3n + 1|2}}}} or {{math|{{sfrac|n|2}}}}, depends on the parity. The parity sequence is the same as the sequence of operations.
Using this form for {{math|f(n)}}, it can be shown that the parity sequences for two numbers {{mvar|m}} and {{mvar|n}} will agree in the first {{mvar|k}} terms if and only if {{mvar|m}} and {{mvar|n}} are equivalent modulo {{math|2k}}. This implies that every number is uniquely identified by its parity sequence, and moreover that if there are multiple Hailstone cycles, then their corresponding parity cycles must be different.
Applying the {{mvar|f}} function {{mvar|k}} times to the number {{math|n {{=}} 2ka + b}} will give the result {{math|3ca + d}}, where {{mvar|d}} is the result of applying the {{mvar|f}} function {{mvar|k}} times to {{mvar|b}}, and {{mvar|c}} is how many increases were encountered during that sequence. For example, for {{math|25a + 1}} there are 3 increases as 1 iterates to 2, 1, 2, 1, and finally to 2 so the result is {{math|33a + 2}}; for {{math|22a + 1}} there is only 1 increase as 1 rises to 2 and falls to 1 so the result is {{math|3a + 1}}. When {{mvar|b}} is {{math|2k − 1}} then there will be {{mvar|k}} rises and the result will be {{math|3ka + 3k − 1}}. The power of 3 multiplying {{mvar|a}} is independent of the value of {{mvar|a}}; it depends only on the behavior of {{mvar|b}}. This allows one to predict that certain forms of numbers will always lead to a smaller number after a certain number of iterations: for example, {{math|4a + 1}} becomes {{math|3a + 1}} after two applications of {{mvar|f}} and {{math|16a + 3}} becomes {{math|9a + 2}} after four applications of {{mvar|f}}. Whether those smaller numbers continue to 1, however, depends on the value of {{mvar|a}}.
=As a tag system=
For the Collatz function in the shortcut form
Hailstone sequences can be computed by the 2-tag system with production rules
:{{math|a → bc}}, {{math|b → a}}, {{math|c → aaa}}.
In this system, the positive integer {{mvar|n}} is represented by a string of {{mvar|n}} copies of {{mvar|a}}, and iteration of the tag operation halts on any word of length less than 2. (Adapted from De Mol.)
The Collatz conjecture equivalently states that this tag system, with an arbitrary finite string of {{mvar|a}} as the initial word, eventually halts (see Tag system for a worked example).
Extensions to larger domains
=Iterating on all integers=
An extension to the Collatz conjecture is to include all integers, not just positive integers. Leaving aside the cycle 0 → 0 which cannot be entered from outside, there are a total of four known cycles, which all nonzero integers seem to eventually fall into under iteration of {{mvar|f}}. These cycles are listed here, starting with the well-known cycle for positive {{mvar|n}}:
Odd values are listed in large bold. Each cycle is listed with its member of least absolute value (which is always odd) first.
class="wikitable" style="text-align: center;"
! Cycle !! Odd-value cycle length !! Full cycle length | ||
style="text-align: left;"| 1 → 4 → 2 → 1 ... | 1 | 3 |
style="text-align: left;"| −1 → −2 → −1 ... | 1 | 2 |
style="text-align: left;"| −5 → −14 → −7 → −20 → −10 → −5 ... | 2 | 5 |
style="text-align: left;"| −17 → −50 → −25 → −74 → −37 → −110 → −55 → −164 → −82 → −41 → −122 → −61 → −182 → −91 → −272 → −136 → −68 → −34 → −17 ... | 7 | 18 |
The generalized Collatz conjecture is the assertion that every integer, under iteration by {{mvar|f}}, eventually falls into one of the four cycles above or the cycle 0 → 0.
= Iterating on rationals with odd denominators =
The Collatz map can be extended to (positive or negative) rational numbers which have odd denominators when written in lowest terms.
The number is taken to be 'odd' or 'even' according to whether its numerator is odd or even. Then the formula for the map is exactly the same as when the domain is the integers: an 'even' such rational is divided by 2; an 'odd' such rational is multiplied by 3 and then 1 is added. A closely related fact is that the Collatz map extends to the ring of 2-adic integers, which contains the ring of rationals with odd denominators as a subring.
When using the "shortcut" definition of the Collatz map, it is known that any periodic parity sequence is generated by exactly one rational.{{Cite journal|last=Lagarias|first=Jeffrey|date=1990|title=The set of rational cycles for the 3x+1 problem|url=https://eudml.org/doc/206298|journal=Acta Arithmetica|volume=56|issue=1|pages=33–53|issn=0065-1036|doi=10.4064/aa-56-1-33-53|doi-access=free}} Conversely, it is conjectured that every rational with an odd denominator has an eventually cyclic parity sequence (Periodicity Conjecture).
If a parity cycle has length {{mvar|n}} and includes odd numbers exactly {{mvar|m}} times at indices {{math|k0 < ⋯ < km−1}}, then the unique rational which generates immediately and periodically this parity cycle is
{{NumBlk|:||{{EquationRef|1}}}}
For example, the parity cycle {{nowrap|(1 0 1 1 0 0 1)}} has length 7 and four odd terms at indices 0, 2, 3, and 6. It is repeatedly generated by the fraction
as the latter leads to the rational cycle
Any cyclic permutation of {{nowrap|(1 0 1 1 0 0 1)}} is associated to one of the above fractions. For instance, the cycle {{nowrap|(0 1 1 0 0 1 1)}} is produced by the fraction
For a one-to-one correspondence, a parity cycle should be irreducible, that is, not partitionable into identical sub-cycles. As an illustration of this, the parity cycle {{nowrap|(1 1 0 0 1 1 0 0)}} and its sub-cycle {{nowrap|(1 1 0 0)}} are associated to the same fraction {{sfrac|5|7}} when reduced to lowest terms.
In this context, assuming the validity of the Collatz conjecture implies that {{nowrap|(1 0)}} and {{nowrap|(0 1)}} are the only parity cycles generated by positive whole numbers (1 and 2, respectively).
If the odd denominator {{mvar|d}} of a rational is not a multiple of 3, then all the iterates have the same denominator and the sequence of numerators can be obtained by applying the "{{math|3n + d}} " generalization of the Collatz function
\frac{x}{2} &\text{if } x \equiv 0 \pmod{2},\\
\frac{3x+d}{2} & \text{if } x\equiv 1 \pmod{2}.
\end{cases}
=2-adic extension=
The function
is well-defined on the ring of 2-adic integers, where it is continuous and measure-preserving with respect to the 2-adic measure. Moreover, its dynamics is known to be ergodic.
Define the parity vector function {{mvar|Q}} acting on as
The function {{mvar|Q}} is a 2-adic isometry.{{Cite journal|last1=Bernstein|first1=Daniel J.|last2=Lagarias|first2=Jeffrey C.|date=1996|title=The 3x + 1 conjugacy map|journal=Canadian Journal of Mathematics|language=en|volume=48|issue=6|pages=1154–1169|doi=10.4153/CJM-1996-060-x|doi-access=free|issn=0008-414X}} Consequently, every infinite parity sequence occurs for exactly one 2-adic integer, so that almost all trajectories are acyclic in .
An equivalent formulation of the Collatz conjecture is that
=Iterating on real or complex numbers{{anchor|Collatz_fractal}}=
File:Collatz Cobweb.svg of the orbit 10 → 5 → 8 → 4 → 2 → 1 → ... in an extension of the Collatz map to the real line.]]
The Collatz map can be extended to the real line by choosing any function which evaluates to when is an even integer, and to either or (for the "shortcut" version) when is an odd integer. This is called an interpolating function. A simple way to do this is to pick two functions and , where:
:
:
and use them as switches for our desired values:
:.
One such choice is and . The iterations of this map lead to a dynamical system, further investigated by Marc Chamberland. He showed that the conjecture does not hold for positive real numbers since there are infinitely many fixed points, as well as orbits escaping monotonically to infinity. The function has two attracting cycles of period : and . Moreover, the set of unbounded orbits is conjectured to be of measure .
Letherman, Schleicher, and Wood extended the study to the complex plane. They used Chamberland's function for complex sine and cosine and added the extra term
, where is any entire function. Since this expression evaluates to zero for real integers, the extended function
:
&\frac{1}{\pi}\left(\frac12 - \cos(\pi z)\right)\sin(\pi z) + h(z)\sin^2(\pi z)\end{align}
is an interpolation of the Collatz map to the complex plane. The reason for adding the extra term is to make all integers critical points of . With this, they show that no integer is in a Baker domain, which implies that any integer is either eventually periodic or belongs to a wandering domain. They conjectured that the latter is not the case, which would make all integer orbits finite.
File:Collatz Fractal.jpg centered at the origin, with real parts from –5 to 5.]]
Most of the points have orbits that diverge to infinity. Coloring these points based on how fast they diverge produces the image on the left, for . The inner black regions and the outer region are the Fatou components, and the boundary between them is the Julia set of , which forms a fractal pattern, sometimes called a "Collatz fractal".
File:Exponential Collatz Fractal.jpg
There are many other ways to define a complex interpolating function, such as using the complex exponential instead of sine and cosine:
:,
which exhibit different dynamics. In this case, for instance, if , then . The corresponding Julia set, shown on the right, consists of uncountably many curves, called hairs, or rays.
{{clear}}
Optimizations
=Time–space tradeoff=
The section As a parity sequence above gives a way to speed up simulation of the sequence. To jump ahead {{mvar|k}} steps on each iteration (using the {{mvar|f}} function from that section), break up the current number into two parts, {{mvar|b}} (the {{mvar|k}} least significant bits, interpreted as an integer), and {{mvar|a}} (the rest of the bits as an integer). The result of jumping ahead {{mvar|k}} is given by
:{{math|f{{isup|k}}(2ka + b) {{=}} 3c(b, k)a + d(b, k)}}.
The values of {{mvar|c}} (or better {{math|3c}}) and {{mvar|d}} can be precalculated for all possible {{mvar|k}}-bit numbers {{mvar|b}}, where {{math|d(b, k)}} is the result of applying the {{mvar|f}} function {{mvar|k}} times to {{mvar|b}}, and {{math|c(b, k)}} is the number of odd numbers encountered on the way.{{cite web |last=Scollo |first=Giuseppe |year=2007 |title=Looking for class records in the 3x + 1 problem by means of the COMETA grid infrastructure |work=Grid Open Days at the University of Palermo |url=http://www.dmi.unict.it/~scollo/seminars/gridpa2007/CR3x+1paper.pdf}} For example, if {{math|k {{=}} 5}}, one can jump ahead 5 steps on each iteration by separating out the 5 least significant bits of a number and using
: {{mvar|c}}(0...31, 5) = { 0, 3, 2, 2, 2, 2, 2, 4, 1, 4, 1, 3, 2, 2, 3, 4, 1, 2, 3, 3, 1, 1, 3, 3, 2, 3, 2, 4, 3, 3, 4, 5 },
: {{mvar|d}}(0...31, 5) = { 0, 2, 1, 1, 2, 2, 2, 20, 1, 26, 1, 10, 4, 4, 13, 40, 2, 5, 17, 17, 2, 2, 20, 20, 8, 22, 8, 71, 26, 26, 80, 242 }.
This requires {{math|2k}} precomputation and storage to speed up the resulting calculation by a factor of {{mvar|k}}, a space–time tradeoff.
=Modular restrictions=
For the special purpose of searching for a counterexample to the Collatz conjecture, this precomputation leads to an even more important acceleration, used by Tomás Oliveira e Silva in his computational confirmations of the Collatz conjecture up to large values of {{mvar|n}}. If, for some given {{mvar|b}} and {{mvar|k}}, the inequality
:{{math|f{{isup|k}}(2ka + b) {{=}} 3c(b)a + d(b) < 2ka + b}}
holds for all {{mvar|a}}, then the first counterexample, if it exists, cannot be {{mvar|b}} modulo {{math|2k}}. For instance, the first counterexample must be odd because {{math|f(2n) {{=}} n}}, smaller than {{math|2n}}; and it must be 3 mod 4 because {{math|f{{isup|2}}(4n + 1) {{=}} 3n + 1}}, smaller than {{math|4n + 1}}. For each starting value {{mvar|a}} which is not a counterexample to the Collatz conjecture, there is a {{mvar|k}} for which such an inequality holds, so checking the Collatz conjecture for one starting value is as good as checking an entire congruence class. As {{mvar|k}} increases, the search only needs to check those residues {{mvar|b}} that are not eliminated by lower values of {{mvar|k}}. Only an exponentially small fraction of the residues survive.{{refn|{{named ref|name=Lagarias (1985)}} Theorem D.}} For example, the only surviving residues mod 32 are 7, 15, 27, and 31.
Integers divisible by 3 cannot form a cycle, so these integers do not need to be checked as counter examples.{{cite web |last=Clay |first=Oliver Keatinge|title=The Long Search for Collatz Counterexamples |url=https://scholarship.claremont.edu/cgi/viewcontent.cgi?article=2052&context=jhm|pages=208|access-date=26 July 2024}}
Syracuse function
If {{mvar|k}} is an odd integer, then {{math|3k + 1}} is even, so {{math|3k + 1 {{=}} 2ak{{prime}}}} with {{math|k{{prime}}}} odd and {{math|a ≥ 1}}. The Syracuse function is the function {{mvar|f}} from the set {{mvar|I}} of positive odd integers into itself, for which {{math|f(k) {{=}} k{{prime}}}} {{OEIS|id=A075677}}.
Some properties of the Syracuse function are:
- For all {{math|k ∈ I}}, {{math|f(4k + 1) {{=}} f(k)}}. (Because {{math|3(4k + 1) + 1 {{=}} 12k + 4 {{=}} 4(3k + 1)}}.)
- In more generality: For all {{math|p ≥ 1}} and odd {{mvar|h}}, {{math|f{{isup|p − 1}}(2ph − 1) {{=}} 2 × 3p − 1h − 1}}. (Here {{math|f{{isup|p − 1}}}} is function iteration notation.)
- For all odd {{mvar|h}}, {{math|f(2h − 1) ≤ {{sfrac|3h − 1|2}}}}
The Collatz conjecture is equivalent to the statement that, for all {{mvar|k}} in {{mvar|I}}, there exists an integer {{math|n ≥ 1}} such that {{math|f{{isup|n}}(k) {{=}} 1}}.
Undecidable generalizations
In 1972, John Horton Conway proved that a natural generalization of the Collatz problem is algorithmically undecidable.{{cite conference |last=Conway |first=John H. |year=1972 |contribution=Unpredictable iterations |title=Proc. 1972 Number Theory Conf., Univ. Colorado, Boulder |pages=49–52}}
Specifically, he considered functions of the form
where {{math|a0, b0, ..., aP − 1, bP − 1}} are rational numbers which are so chosen that {{math|g(n)}} is always an integer. The standard Collatz function is given by {{math|P {{=}} 2}}, {{math|a0 {{=}} {{sfrac|1|2}}}}, {{math|b0 {{=}} 0}}, {{math|a1 {{=}} 3}}, {{math|b1 {{=}} 1}}. Conway proved that the problem
: Given {{mvar|g}} and {{mvar|n}}, does the sequence of iterates {{math|gk(n)}} reach {{math|1}}?
is undecidable, by representing the halting problem in this way.
Closer to the Collatz problem is the following universally quantified problem:
: Given {{mvar|g}}, does the sequence of iterates {{math|gk(n)}} reach {{math|1}}, for all {{math|n > 0}}?
Modifying the condition in this way can make a problem either harder or easier to solve (intuitively, it is harder to justify a positive answer but might be easier to justify a negative one). Kurtz and Simon{{cite book |last1=Kurtz |first1=Stuart A. |last2=Simon |first2=Janos |editor1-last=Cai |editor1-first=J.-Y. |editor2-last=Cooper |editor2-first=S. B. |editor3-last=Zhu |editor3-first=H. |year=2007 |chapter-url=https://books.google.com/books?id=mhrOkx-xyJIC&pg=PA542 |chapter=The undecidability of the generalized Collatz problem |title=Proceedings of the 4th International Conference on Theory and Applications of Models of Computation, TAMC 2007, held in Shanghai, China in May 2007 |isbn=978-3-540-72503-9 |doi=10.1007/978-3-540-72504-6_49 |pages=542–553}} As [http://www.cs.uchicago.edu/~simon/RES/collatz.pdf PDF] proved that the universally quantified problem is, in fact, undecidable and even higher in the arithmetical hierarchy; specifically, it is {{math|Π{{su|b=2|p=0}}}}-complete. This hardness result holds even if one restricts the class of functions {{mvar|g}} by fixing the modulus {{mvar|P}} to 6480.{{cite journal |last=Ben-Amram |first=Amir M. |year=2015 |title=Mortality of iterated piecewise affine functions over the integers: Decidability and complexity |journal=Computability |doi=10.3233/COM-150032 |volume=1 |issue=1 |pages=19–56}}
Iterations of {{mvar|g}} in a simplified version of this form, with all equal to zero, are formalized in an esoteric programming language called FRACTRAN.
In computational complexity
Collatz and related conjectures are often used when studying computational complexity.{{cite journal |author=Michel, Pascal |title=Busy beaver competition and Collatz-like problems |journal=Archive for Mathematical Logic |volume=32 |issue=5 |year=1993 |pages=351–367|doi=10.1007/BF01409968 }}{{cite web |url=https://arxiv.org/html/2107.12475v2 |title=Hardness of busy beaver value BB(15)}} The connection is made through the busy beaver function, where BB(n) is the maximum number of steps taken by any n state Turing machine that halts. There is a 15 state Turing machine that halts if and only if a conjecture by Paul Erdős (closely related to the Collatz conjecture) is false. Hence if BB(15) was known, and this machine did not stop in that number of steps, it would be known to run forever and hence no counterexamples exist (which proves the conjecture true). This is a completely impractical way to settle the conjecture; instead it is used to suggest that BB(15) will be very hard to compute, at least as difficult as settling this Collatz-like conjecture.
See also
{{portal|Mathematics}}
{{commons category}}
Notes
{{notelist}}
References
{{Reflist|30em|refs=
{{cite journal |first=Jeffrey C. |last=Lagarias |title=The 3x + 1 problem and its generalizations |journal=The American Mathematical Monthly |volume=92 |issue=1 |pages=3–23 |year=1985 |jstor=2322189|doi=10.1080/00029890.1985.11971528 }}
{{cite journal |last=Garner |first=Lynn E. |year=1981 |title=On the Collatz 3n + 1 algorithm |journal=Proceedings of the American Mathematical Society |volume=82 |issue=1 |pages=19–22 |doi=10.1090/S0002-9939-1981-0603593-2 |doi-access=free |jstor=2044308}}
{{cite book |last=Guy | first=Richard K. | author-link=Richard K. Guy | title=Unsolved Problems in Number Theory | publisher=Springer-Verlag |edition=3rd | year=2004 |isbn=0-387-20860-7 | zbl=1058.11001 | chapter="E16: The 3x+1 problem" |pages=330–6 |chapter-url=https://books.google.com/books?id=1AP2CEGxTkgC&pg=PA330}}
{{cite book |editor1-last=Lagarias |editor1-first=Jeffrey C. |editor1-link=Jeffrey Lagarias |year=2010 |title=The Ultimate Challenge: The 3x + 1 Problem |publisher=American Mathematical Society |isbn=978-0-8218-4940-8 |zbl=1253.11003}}
}}
External links
- {{cite web |url=http://www.numbertheory.org/3x+1/ |first=Keith |last=Matthews |title={{nobr|3 {{mvar|x}} + 1}} page}}
- An ongoing volunteer computing [https://collatz-problem.org/ project] {{Webarchive|url=https://web.archive.org/web/20210830110430/https://collatz-problem.org/ |date=2021-08-30 }} by David Bařina verifies Convergence of the Collatz conjecture for large values. (furthest progress so far)
- (BOINC) volunteer computing [http://boinc.thesonntags.com/collatz/ project] {{Webarchive|url=https://web.archive.org/web/20171204131813/http://boinc.thesonntags.com/collatz/ |date=2017-12-04 }} that verifies the Collatz conjecture for larger values.
- An ongoing volunteer computing [http://www.ericr.nl/wondrous/index.html project] by Eric Roosendaal verifies the Collatz conjecture for larger and larger values.
- Another ongoing volunteer computing [http://sweet.ua.pt/tos/3x+1.html project] by Tomás Oliveira e Silva continues to verify the Collatz conjecture (with fewer statistics than Eric Roosendaal's page but with further progress made).
- {{MathWorld | urlname=CollatzProblem | title=Collatz Problem}}
- {{PlanetMath | urlname=CollatzProblem | title=Collatz Problem}}.
- {{cite web |first=Jesse |last=Nochella |title=Collatz Paths |work=Wolfram Demonstrations Project |url=http://demonstrations.wolfram.com/CollatzPaths/ }}
- {{cite AV media |medium=short video |people=Eisenbud, D. |title=Uncrackable? The Collatz conjecture |series=Numberphile |date=8 August 2016 |via=YouTube |url=https://www.youtube.com/watch?v=5mFpVDpKX70 |archive-url=https://ghostarchive.org/varchive/youtube/20211211/5mFpVDpKX70| archive-date=2021-12-11 |url-status=live}}{{cbignore}}
- {{cite AV media |people=Eisenbud, D. |title=Uncrackable? Collatz conjecture |medium=extra footage |series=Numberphile |date=August 9, 2016 |via=YouTube |url=https://www.youtube.com/watch?v=O2_h3z1YgEU |archive-url=https://ghostarchive.org/varchive/youtube/20211211/O2_h3z1YgEU| archive-date=2021-12-11 |url-status=live}}{{cbignore}}
- {{cite AV media |medium=short video |people=Alex Kontorovich (featuring) |title=The simplest math problem no one can solve |date=30 July 2021 |series=Veritasium |via=YouTube |url=https://www.youtube.com/watch?v=094y1Z2wpJg}}
- [https://www.technologyreview.com/2021/07/02/1027475/computers-ready-solve-this-notorious-math-problem/ Are computers ready to solve this notoriously unwieldy math problem?]