The Collatz Conjecture


The Collatz Conjecture is a famous unsolved problem in mathematics.

It is also referred to as the 3N+1 problem, Ulam conjecture, Kakutani's problem, the Thwaites conjecture, Hasse's algorithm, or the Syracuse problem. Wikipedia article

The Collatz Conjecture is considered 'hazardous' by some (perhaps to one's mental health, or perhaps one's career as a mathematician.)

This is a really dangerous problem. People become obsessed with it and it really is impossible. Jeffrey Lagarias, the University of Michigan (Quoted in Quanta Magazine)


The Conjecture concerns a sequence of positive integers that can be constructed with the following rules:

Whenever the current term is even, the next term is half of the current term.

Whenever the current term is odd, the next term is 3 times the current term plus 1 .


The Collatz Conjecture is that these sequences always reach 1, no matter which positive integer is used to start the sequence.

It has been tested with quintillions (i.e. 1,000,000,000,000,000,000s) of initial values but has not been mathematically proved to be true.


This ShinyR app allows you try different starting values in the range 1-301. Once the sequence reaches 1 we stop plotting, however the sequence would actually cycle thereafter through the values 1 4 2 1 4 2 1 ...

What do you observe when the initial value is a power of 2?

The graph on the right shows the number of iterations taken for each of the initial values considered in the app. The cross hairs will help you locate the number of iterations required to reach 1, for your selected initial value. The numbers of iterations fluctuate quite wildly. Try a few values either side of a power of 2.


Note: Logarithmic scale on the vertical axis.


For information about the Research Computing Centre hosting a ShinyR app for your UQ research,

please contact Dr David Green via email to rcc-support@uq.edu.au