MathsNumber Theory

Collatz Sequence
calculator.

Follow any start through the 3n + 1 rule and count the steps it takes to reach 1.

How it's worked out

Start with any positive whole number. If it is even, halve it. If it is odd, triple it and add 1. Repeat until you reach 1. Lothar Collatz posed the question in 1937: does every start get there?

n→n2\displaystyle n \to \frac{n}{2}if n is even\displaystyle \text{if } n \text{ is even}
n→3n+1\displaystyle n \to 3n + 1if n is odd\displaystyle \text{if } n \text{ is odd}

From 6 the path is 6, 3, 10, 5, 16, 8, 4, 2, 1, which is 8 steps. From 7 it takes 16 steps and climbs to 52 on the way.

Total steps counts every halving and every tripling until the path reaches 1. This is OEIS A006577, where 27 gives 111. The tool also splits the count into tripling steps, OEIS A006667, and halving steps.

A tripling step is always followed by a halving step. An odd number times 3 is odd, and adding 1 makes it even. So the path can never triple twice in a row.

Stopping time counts steps only until the path first drops below its start. For 27 that is 96, while reaching 1 takes 111. The peak is the largest value on the path, listed for each start in OEIS A025586.

Worked examples

Theo sees why 27 is the classic start

Theo tries every start below 27 and none takes more than 23 steps. Then 27 takes 111. It begins 27, 82, 41, 124 and keeps rising.

It climbs to 9,232 at step 77, about 342 times where it began. It makes 41 tripling steps and 70 halving steps. Nothing about 27 hints at this, which is why the puzzle is hard.

Open this example in the tool

Mia finds the slowest start below 1,000

OEIS A006877 lists the starts that take longer than every smaller one: 27, 54, 73, 97, 129 and so on. Below 1,000 the last of them is 871, with 178 steps. A sweep of 1 to 1,000 agrees: the longest path starts at 871.

The slowest start is not the one that climbs highest. 703 reaches 250,504, while 871 peaks at 190,996.

Open this example in the tool

Raj checks a path that outgrows a spreadsheet

Raj starts at 319,804,831. The path climbs to 1,414,236,446,719,942,480 at step 167 and reaches 1 after 592 steps.

That peak is past 9,007,199,254,740,991, the largest whole number a double holds exactly. A tool working in doubles would round it and every term after it. Here each term is exact, so the count is right.

Open this example in the tool

Reading your result

No formula gives the count. Starting at 26 takes 10 steps, and 27 takes 111. Powers of 2 are the easy case: they only halve, so 2642^{64} takes 64 steps. Most other starts mix climbs and falls.

The chart. The path is drawn step by step, with the peak marked. A log scale shows the number of digits instead of the value, which makes a long path easier to read. Drag the point to read any step.

What is known. The conjecture is unproved. David Barina's project reports in January 2025 that every start below 2712^{71} reaches 1. Terence Tao proved that almost all starts, in a log density sense, sooner or later fall below any bound that grows to infinity, however slowly. That still leaves room for a rare exception.

A counterexample would need a path that grows forever, or one that falls into a loop other than 4, 2, 1. None has been found.

Common mistakes

  • Counting terms instead of steps. The path of 27 has 112 numbers in it but 111 steps, since the start itself is not a step.
  • Mixing up stopping time and total steps. For 27 they are 96 and 111. Check which one a textbook or a puzzle asks for.
  • Using a spreadsheet for large starts. Once a term passes the largest whole number a double holds exactly, the odd or even test goes wrong and the path drifts.
  • Treating a big search as a proof. Checking every start below a bound shows no small exception exists. It does not rule out one larger than any yet checked.

Questions people ask

No. Computer searches have checked every start below 2 to the power 71 as of January 2025, and Terence Tao proved in 2019 that almost all starts get close to small values. Neither covers every number, and none of the proofs posted online has been accepted.

Sources