Plotting Collatz Sequences
Plotting Collatz Sequences
The Collatz conjecture, also called the problem as well as other things, is a mathematical conjecture named after Lothar Collatz, who first proposed it in 1937. It concerns the behavior of the iterates of a simple piecewise function, starting from a positive integer .
3n+1
n
Start with a positive integer and apply the following algorithm: if , stop; otherwise if is even, replace with ; and otherwise if is odd, replace with . Apply the preceding rule again to the newly generated . The conjecture is that for any initial positive integer , the sequence eventually reaches 1, where it ends.
n
n=1
n
n
n/2
n
n
3n+1
n
n
No proof that the conjecture is true for all has yet been found and no counterexample has been produced.
n
This Demonstration generates and displays the Collatz sequences for through in numerical and graphical forms.
n=1
n=5000