Advertisement
Advertisement
NUMBER THEORY

Collatz Conjecture Calculator — 3n+1 trajectory, stopping time and peak

Generate the full Collatz orbit of any starting number, with its total stopping time, its delay and the highest value it reaches on the way down.

Any positive whole number. Arbitrarily large values are handled exactly — the tool uses big-integer arithmetic, so nothing is rounded.
The cap stops the loop and prints a message rather than letting the page hang. No known starting value has ever failed to reach 1, but the conjecture is unproven, so a cap is the honest way to write this.
Only affects how much of the orbit is printed below. The counts and the peak are always computed over the whole run.
Total stopping time (steps to reach 1)
 
Peak value reached
Delay: steps to first drop below n
Odd steps (3n+1 applied)
Even steps (halving)
Trajectory: press Generate to list the orbit.
Advertisement

The Collatz conjecture calculator above takes a starting whole number, applies the 3n+1 rule over and over, and prints the entire sequence it produces along with the four numbers people actually want from it: how many steps the orbit takes to land on 1, how high it climbs before it gets there, how long it takes to first fall below where it started, and how that step count splits between odd and even moves. It is a small piece of arithmetic wrapped around one of the most stubborn open problems in mathematics.

Arb Digital builds free calculators for the topics people actually search for, and this one sits in an unusual corner: it is a tool for a question nobody has answered. The rule is trivial enough to teach a ten-year-old. Whether it always terminates has resisted every serious attempt at proof for more than eighty years. This page computes what is computable and is careful to say where the computing stops and the open problem begins.

What This Collatz Conjecture Calculator Does

Enter a starting value and the tool applies the Collatz map repeatedly. If the current number is even it halves it. If the current number is odd it multiplies by three and adds one. It records every value along the way, stops when it reaches 1, and reports the results.

The headline figure is the total stopping time: the number of applications of the rule needed to reach 1 from your starting value. The supporting grid gives the peak, which is the largest number the orbit ever touches; the delay, meaning the number of steps before the sequence first drops strictly below the starting value; and the split of the run into odd steps (where 3n+1 was applied) and even steps (where the value was halved). A bar row shows that split visually, because the ratio between the two is the whole reason the sequence tends downward at all.

You can switch between the standard map and the shortcut map. The shortcut form folds the guaranteed halving that always follows 3n+1 into a single step, since 3n+1 for odd n is always even. It produces the same orbit shape with a shorter step count, and it is the form most research papers use.

Arithmetic is done with JavaScript BigInt, so there is no floating-point rounding and no silent overflow. A starting value with forty digits behaves exactly as it should.

How to Use It

  1. Type a starting number. Any positive whole number. Try 27 for the classic surprise, or 97 for a long run from a small start.
  2. Pick a rule. Standard is what most textbooks and puzzle pages mean by "Collatz". Shortcut is the compressed form used in the research literature.
  3. Set an iteration cap. The default of 5,000 is far beyond what any small number needs. Raise it if you are exploring very large starting values.
  4. Choose how many terms to display. This is presentation only. The peak and the step counts are always computed over the entire orbit, whether or not you print all of it.
  5. Read the four supporting numbers, not just the step count. The peak and the delay tell you far more about the character of an orbit than its length does.

The Formula / How It's Calculated

The Collatz map is defined on positive integers as a two-case rule. For even n the next term is n divided by 2. For odd n the next term is 3n + 1. Written compactly: f(n) = n/2 if n is even, and f(n) = 3n + 1 if n is odd. The conjecture is the claim that repeating f from any positive starting integer eventually produces 1.

Take n = 27 as the worked example that the calculator loads by default. The orbit begins 27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, and keeps going. It climbs to a peak of 9,232, and it takes 111 steps in total to arrive at 1. Of those 111 steps, 41 are odd steps and 70 are halvings. That is an enormous excursion for a starting number under thirty, and it is the standard demonstration that orbit length has almost nothing to do with the size of the seed.

The shortcut map replaces the odd case with (3n + 1)/2, which is legitimate because 3n + 1 is always even when n is odd. Under the shortcut rule, 27 reaches 1 in 70 steps rather than 111 — the 41 odd steps each absorb the halving that used to follow them. The orbit visits a subset of the same values; nothing about the eventual outcome changes.

Delay is computed separately from total stopping time. It is the smallest number of steps after which the value is strictly less than the starting number. For 27, that takes 96 steps, because the orbit spends most of its life above where it began. For a number like 6, the delay is 1: half of 6 is 3, which is already below 6. Delay is the more meaningful statistic when you are asking whether the map "makes progress", since total stopping time is dominated by the long tail of halvings at the end.

Advertisement

The Conjecture Is Unproven — Say It Plainly

Every value this page computes is a fact about one specific starting number. None of them is evidence that the conjecture is true in general, and this tool makes no claim that it is. As of today the Collatz conjecture — also called the 3n+1 problem, the Syracuse problem, Kakutani's problem and Ulam's conjecture — has not been proved. It has been verified by computer for every starting value up to enormous bounds, and no counterexample has ever been found, but verification up to a bound is not a proof for all integers.

Jeffrey Lagarias's annotated bibliography of the 3x+1 problem catalogues nearly two hundred papers on the question and states directly that the conjecture remains unsolved. The strongest modern partial result is Terence Tao's paper showing that almost all Collatz orbits attain almost bounded values — a genuinely major advance, and still not a proof of the conjecture itself. "Almost all" in that sense leaves room for an exceptional set, and a single member of an exceptional set is all a counterexample would need to be.

There are two ways the conjecture could fail. A starting number could run off to infinity without ever settling, or it could fall into a cycle that does not contain 1. Neither has been ruled out by proof. Both have been ruled out computationally within the ranges that have been searched, which is a different and much weaker statement.

Why the Sequence Tends Downward Anyway

There is a heuristic argument for why orbits usually shrink, and understanding it explains why the odd and even step counts in the result grid are worth looking at. When you apply 3n+1 to an odd number and then immediately halve, the value grows by a factor of roughly 3/2. When you halve an even number, it shrinks by a factor of 2. If odd and even outcomes were equally likely at each stage — which they are not, but which is a reasonable first approximation — a typical step would multiply the value by the geometric mean of 3/2 and 1/2, which is about 0.866. Less than one, so the orbit drifts down.

That is a probabilistic story about typical behaviour, not a proof about every integer. It fails as a proof precisely because the terms in a Collatz orbit are not independent random draws. They are determined completely by the starting value. The gap between "behaves like a random walk with downward drift" and "provably reaches 1 from every start" is where eighty years of work has piled up.

The ratio you can see in the bar row is a direct read on this. For a run that reaches 1, the number of halvings must exceed the number of odd steps by enough to undo all the tripling. If you check several starting numbers, the ratio of even steps to odd steps hovers around 1.7 in most orbits — close to the value the heuristic predicts, which is log 3 / log 2, roughly 1.585, plus the extra halvings from the final descent.

Peak Values, and Why Small Starts Can Go Very High

The peak is the most under-appreciated statistic here. Starting at 27 the orbit reaches 9,232, which is over three hundred times the seed. Starting at 703 the orbit reaches 250,504. There is no simple relationship between the starting number and its peak, and this is one of the reasons the problem is hard: the map does not respect size in any useful way, so ordinary inductive arguments have nothing to bite on.

Peak values matter practically too. If you write your own Collatz code in a language with fixed-width integers, the peak is what overflows, not the starting value. A 64-bit signed integer copes with every seed below about 260, but only if you never let an intermediate value exceed the same bound — and intermediate values regularly exceed the seed by several orders of magnitude. That is why this calculator uses arbitrary-precision arithmetic rather than ordinary numbers. If you want to see how quickly ordinary integer types run out of room, our scientific notation converter and exponent calculator make the scale concrete.

Records, Long Orbits and What to Try Next

Some starting values are famous for how long they take. Under 100, the winner is 97, which takes 118 steps. Under 1,000, the record holder is 871 at 178 steps. Under 10,000, it is 6,171 at 261 steps. Numbers that set a new record for total stopping time relative to everything smaller are called class records, and hunting them is a common first computational project for anyone learning about the problem.

Another good exercise: pick any number and its double. The doubled value always takes exactly one more step, because the first move is a halving that lands you straight back on the original orbit. That single observation is why the interesting behaviour lives entirely in odd starting values, and why serious searches skip evens.

Where This Sits Among Sequence Tools

A Collatz orbit is a recursively defined sequence, but it is not one of the standard closed-form families. There is no formula for the nth term the way there is for an arithmetic or geometric progression, which is exactly what makes it interesting. If you want the ordinary sequence types with predictable formulas, use the arithmetic sequence calculator or the geometric sequence calculator. For the other classic recursive sequence, the Fibonacci calculator covers it. The parity test that drives every Collatz step is ordinary division with remainder, which the modulo calculator handles directly, and the prime factorization calculator is useful if you want to see why the powers of two in a number determine how far it falls in one descent.

Need calculators like this one on your own site?

Arb Digital builds fast, accessible, genuinely useful interactive tools that earn links and rankings instead of just filling a page. Browse what we have already published, or tell us what your audience keeps searching for.

Browse the Free Tools Hub Talk to Arb Digital

Common Mistakes to Avoid

  • Reporting a verified range as a proof. "Checked to 268" is a computational result. The conjecture is still open, and describing it as solved is simply wrong.
  • Mixing up the two rules. A step count from the shortcut map is not comparable to one from the standard map. Always state which form produced the number.
  • Confusing delay with total stopping time. Delay is the first drop below the seed; total stopping time is the trip all the way to 1. For 27 those are 96 and 111 — different questions, different answers.
  • Using fixed-width integers. The peak, not the seed, is what overflows. Code that looks fine on small inputs fails silently on larger ones.
  • Counting the starting value as a step. The step count is the number of times the rule is applied, so the orbit of 1 has a total stopping time of zero, not one.

Related Free Tools From Arb Digital

Explore the neighbouring maths tools: the modulo calculator for the parity arithmetic behind each step, the factorial calculator and Fibonacci calculator for other fast-growing integer sequences, the number base converter if you want to watch a Collatz orbit in binary, the logarithm calculator for the log 3 / log 2 ratio behind the drift argument, and the prime factorization calculator for the powers of two that control each descent. The full free online tools hub lists everything.

Frequently Asked Questions

Has the Collatz conjecture been proved?

No. It remains an open problem. It has been verified computationally for every starting value up to very large bounds and no counterexample is known, but verification up to a bound is not a proof for all positive integers, and no accepted proof exists.

What is the total stopping time of 27?

Under the standard rule, 27 reaches 1 in 111 steps, made up of 41 odd steps and 70 halvings, and the orbit peaks at 9,232. Under the shortcut rule the same orbit takes 70 steps because each odd step absorbs the halving that follows it.

What is the difference between delay and total stopping time?

Delay is the number of steps until the sequence first falls strictly below the starting value. Total stopping time is the number of steps until it reaches 1. For 27 the delay is 96 and the total stopping time is 111.

Why does the calculator have an iteration cap?

Because the conjecture is unproven, no program can assume in advance that a given orbit terminates. The cap stops the loop and prints a message instead of letting the browser hang, which is the honest way to write code for an open problem.

Can a Collatz orbit go on forever?

Nobody knows. The two ways the conjecture could fail are an orbit that grows without bound and an orbit that falls into a cycle not containing 1. Neither has been ruled out by proof, and neither has been observed in any search so far.

Why do intermediate values get so large?

The 3n+1 step multiplies by three, and a run of odd steps separated by single halvings compounds that growth quickly. Starting at 27 the orbit reaches 9,232 before it descends, which is why fixed-width integer types can overflow even when the starting value is tiny.

What is the shortcut Collatz map?

It replaces the odd rule 3n+1 with (3n+1)/2, which is valid because 3n+1 is always even when n is odd. It produces the same eventual outcome with a shorter step count and is the form usually used in research papers.

This page is a mathematics teaching tool. It reports facts about the specific orbits you ask it to compute and makes no claim about the truth of the Collatz conjecture, which is an open problem in number theory.

Advertisement
Advertisement

Take it further