Collatz Sequence Calculator
3n + 1 sequence steps, peak value and hailstone chart.
About this tool
Enter any positive whole number, however large. The tool shows how many steps it takes to reach 1, the highest value reached, the numbers of odd and even steps, a log-scale chart and the full sequence. You can also find the start number with the longest sequence below a limit.
The Collatz conjecture
Take any positive integer. If it's even, halve it; if it's odd, multiply by 3 and add 1. Repeat. The Collatz conjecture, posed by Lothar Collatz in 1937, says you always reach 1 eventually. It has been checked by computer for every number up to about 2.95 Γ 10Β²β°, yet it remains unproven; Paul ErdΕs said mathematics 'is not yet ready for such problems'. The sequences rise and fall unpredictably, like hailstones in a cloud, which is why they're called hailstone numbers. 27 is famous: it takes 111 steps and climbs to 9,232 before dropping to 1, while 28 needs only 18. Below 10,000 the longest sequence starts at 6,171 (261 steps); below a million it's 837,799 (524 steps). This calculator uses arbitrary-precision integers, so you can try numbers with hundreds of digits. The chart uses a log scale so both small and huge values are visible. Honest limits: display is capped at 100,000 steps, far more than any known starting value needs. The number sequence calculator and the prime number checker are related.
Frequently asked questions
What is the Collatz conjecture?
The claim that repeatedly halving even numbers and turning odd n into 3n + 1 always reaches 1. It is unproven.
How many steps does 27 take?
111 steps, peaking at 9,232.
Has the Collatz conjecture been proved?
No. It has been verified for all numbers up to about 2.95 Γ 10Β²β°, but no proof exists.
Which number under a million has the longest sequence?
837,799, with 524 steps.
Is my data sent anywhere?
No. Everything is calculated in your browser, and nothing is stored or sent.