About the Collatz Sequence Calculator
This Collatz sequence calculator applies the famous 3n + 1 rule to any starting number: if n is even, halve it; if n is odd, triple it and add 1. It prints the whole hailstone sequence until it reaches 1, counts the steps (the total stopping time), finds the highest value the sequence climbs to and where, splits the steps into odd and even moves, and charts the path so you can see it rise and fall.
The Collatz conjecture — that every positive integer eventually reaches 1 — is one of the best-known unsolved problems in mathematics: it has been checked by computer for enormous ranges of numbers, yet nobody has proved it. The calculator is a fun way for students, teachers and puzzle fans to explore it, compare famous starting values like 27 (111 steps, peaking at 9,232), and test numbers of their own.
Starting values up to 10¹⁵ are supported, and all arithmetic uses exact big integers so even huge peaks are correct. The full sequence is listed up to the first 1,000 terms.
With the default inputs, the steps to reach 1 (total stopping time) is 111. Change any value above to recalculate instantly.
How to use the collatz sequence calculator
- 1Enter a positive whole number as the starting value.
- 2Read how many steps the sequence takes to reach 1.
- 3Check the peak value and the step where it occurs.
- 4Follow the chart and table to see each halve or 3n + 1 move.
- 5Try neighbouring numbers to compare their hailstone paths.
Formula and method
Starting from any positive integer, repeatedly apply the Collatz map: halve even numbers, and replace odd numbers with 3n + 1 (which is always even, so a halving follows). The number of steps needed to reach 1 is the total stopping time; the stopping time is the first step at which the value drops below the starting number.
The Collatz conjecture, posed by Lothar Collatz in 1937, states that every starting value eventually reaches the cycle 4 → 2 → 1. It has been verified by computer for every starting number up to at least 2⁶⁸ (about 2.95 × 10²⁰), but there is still no proof. Sequences can rise far above their starting value before falling — 27 climbs to 9,232 — which is why they are nicknamed hailstone sequences.
- n
- Current value in the sequence
- Total stopping time
- Steps until the sequence first reaches 1
- Stopping time
- Steps until the value first falls below the start
Worked examples
The famous n = 27
Although it starts small, 27 takes 111 steps (41 odd, 70 even) to reach 1 and soars to 9,232 on the way. It does not drop below 27 until step 96.
A short one: n = 6
6 → 3 → 10 → 5 → 16 → 8 → 4 → 2 → 1: eight steps, peaking at 16. Once a sequence hits a power of 2 it halves straight down to 1.
n = 97
97 has the longest path of any start below 100: 118 steps. It drops below 97 already at step 3 (97 → 292 → 146 → 73), then joins the same route as 27 and peaks at 9,232 on step 84.
n = 837,799
Below one million, 837,799 has the longest total stopping time: 524 steps, reaching a peak of 2,974,984,576 — over 3,500 times its starting value.
Frequently asked questions
What is the Collatz conjecture?+
It is the unproven claim that if you start from any positive integer and repeatedly halve even numbers and send odd numbers to 3n + 1, you always end at 1. It is also called the 3n + 1 problem, the Ulam conjecture or the hailstone problem.
Has the Collatz conjecture been proven?+
No. Computers have checked every starting number up to at least 2⁶⁸ (about 2.95 × 10²⁰) and all reach 1, and Terence Tao proved in 2019 that almost all orbits attain almost bounded values, but a full proof remains open.
Why are Collatz sequences called hailstone sequences?+
The values rise and fall repeatedly before eventually dropping to 1, like hailstones being carried up and down inside a storm cloud before falling to the ground.
Which number under 100 takes the most steps?+
Among starting values below 100, 97 takes the longest: 118 steps. Below 1,000 the record is 871 with 178 steps, and below one million it is 837,799 with 524 steps.
What is the difference between stopping time and total stopping time?+
Total stopping time counts the steps to reach 1. Stopping time counts the steps until the sequence first falls below its starting value — for 27 that happens at step 96, while reaching 1 takes 111.