Collatz Sequence Length Calculator

Count the steps a number takes to reach 1 in the 3n+1 sequence, plus the highest value it hits.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

The Collatz conjecture (also called the 3n+1 problem) starts from a simple rule applied repeatedly to any positive integer: if the number is even, divide it by 2; if it’s odd, multiply by 3 and add 1. The conjecture — unproven despite being checked for every integer up into the quintillions — claims that no matter which starting number you pick, this process always eventually reaches 1. This calculator counts how many steps that takes, and tracks the highest value the sequence hits along the way.

Some starting numbers reach 1 in a handful of steps; others, like 27, balloon up past 9,000 before finally descending, which is part of what makes the conjecture so notoriously hard to prove despite its childishly simple rule. It’s a favorite in recreational mathematics and a classic first exercise in programming courses for practicing loops and conditionals, and it remains a genuinely open problem in number theory — Paul Erdős famously said mathematics wasn’t ready for it.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators