Toolstia / Collatz sequence calculator
Collatz sequence calculator
Enter a starting number and follow the Collatz rule until it reaches 1. See how many steps it takes, the highest value on the way and the full sequence.
The rule: if the number is even, halve it; if it is odd, multiply by 3 and add 1. Every number tested so far reaches 1, but nobody has proved it always happens.
How it works
- Enter a whole number of 1 or more.
- Read the number of steps and the peak.
- Copy the sequence if you need it.
The rule
If the number is even, halve it. If it is odd, multiply by 3 and add 1. Repeat until you reach 1.
The conjecture
Every number ever tested reaches 1, but nobody has proved that it always does. It is one of the best known unsolved problems in mathematics.
Surprising lengths
Starting from 27 takes 111 steps and climbs to 9,232 before falling back to 1.
Big numbers
The calculation uses exact whole-number arithmetic, so large starting values do not lose precision.
Questions
What is the longest sequence?
Below one million, 837,799 takes the most steps, 524. Everything happens in your browser, and nothing you enter is sent anywhere.
Why are only some values listed?
Very long sequences are cut at 5,000 values for display. The step count still covers all of them.
What about 0 or negative numbers?
The rule is defined for positive whole numbers only.