Collatz Sequence Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026

The Collatz sequence applies n→n/2 if n is even, n→3n+1 if it is odd, until it reaches 1. For n=27, the most cited example of this conjecture, it takes exactly 111 steps, with a maximum value of 9232 reached along the way — a striking example given how small the starting number is.

Explanation

The Collatz conjecture (also called the Syracuse conjecture, or 3n+1 problem, after the mathematician who formulated it in 1937) states a deceptively simple rule: take a positive integer, divide it by 2 if it is even, or multiply it by 3 and add 1 if it is odd, then repeat the operation on the result. The conjecture asserts that this sequence always eventually reaches 1, whatever starting integer is chosen — a statement verified computationally for all starting values up to considerable magnitudes, with no counterexample ever found, but which remains to this day one of the most famous unsolved problems in all of mathematics, despite a statement accessible to a middle-schooler. The number 27 is the most often cited example to illustrate how unpredictable this sequence's behavior can be: starting from such a modest number, the sequence climbs to a peak of 9232 before coming back down, in a total of 111 steps — a chaotic trajectory that contrasts sharply with the simplicity of the rule generating it. This calculator directly complements our factorial calculator and our prime number calculator, two other elementary notions of number theory and discrete mathematics that, like the Collatz sequence, are defined in a few words but hold considerable mathematical depth. As a precaution against an unproven conjecture, this calculator applies a safety cap to the number of steps computed: if a starting number never converged to 1 (which no known example has ever shown), the calculation would stop with an explicit message rather than run forever.

Example: the sequence starting from 6

Inputs

Starting number: 6.

Calculation

6 → 3 → 10 → 5 → 16 → 8 → 4 → 2 → 1, that is 8 steps in total, with a maximum reached of 16 (at the very start of the sequence, even before the first odd number).

Result

The Collatz sequence starting from 6 reaches 1 in 8 steps, never exceeding the value 16.

Frequently asked questions

Why is the Collatz conjecture still unproven?

Because the sequence's behavior is extremely chaotic and unpredictable from one starting number to another, with no simple algebraic structure that would allow a general proof — two very close starting numbers can produce radically different trajectories in length and amplitude. The best current mathematical tools can computationally verify billions of specific cases, but no known method can prove the statement for ALL positive integers simultaneously.

Is there a starting number for which the sequence never comes back down to 1?

None has ever been found, despite exhaustive computational checks covering all starting values up to magnitudes on the order of 2⁶⁸ and beyond. This is not a mathematical proof (a counterexample could in theory exist beyond the values already tested), but it is a very strong statistical indication in favor of the conjecture, which is still actively studied by mathematicians.

Why does the number of steps vary so much from one starting number to another?

Because the rule alternates between two operations with opposite effects (divide by 2, which quickly reduces the value, and multiply by 3 then add 1, which increases it), and the frequency at which each operation applies depends in a complex and unpredictable way on the binary structure of the starting number. It is this sensitivity to the smallest details that makes the final step count so hard to predict without unrolling the sequence step by step, exactly what this calculator does.

Related resources

Similar calculators