Collatz Conjecture Calculator

Find the Collatz steps for a number.

Result

111
9,232

How it is calculated

The Collatz rule is applied repeatedly to a starting integer n: if n is even, replace it with n / 2; if odd, replace it with 3n + 1. The tool counts how many applications it takes to reach 1 (steps) and records the largest value seen along the way (peak, which includes the starting number). Decimals are cut to a whole number, and the start must be at least 1. The loop stops after 100,000 steps as a safety limit. Whether every start reaches 1 is the unproven Collatz conjecture; every number tested so far does.

Worked example

Start at 27. The path begins 27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214 and keeps climbing in bursts. After 111 steps it finally reaches 1, and the highest value it touched along the way is 9,232. So a small start of 27 climbs more than 340 times higher before falling back.

Try this example →

Common mistakes

  • Starting with 0 or a negative number; the rule is only defined here for positive integers.
  • Counting the starting number as a step; steps count transformations, so reaching 1 from 2 is 1 step.
  • Confusing the peak with the final value; the end is always 1, while the peak is the maximum along the path.
  • Entering a decimal such as 27.9 and expecting it to be rounded up; it is truncated to 27.

About this calculator

This calculator runs the Collatz conjecture sequence (also called the 3n+1 problem) on any starting number: if it's even, divide by 2; if it's odd, multiply by 3 and add 1. Repeat until you hit 1, and the calculator reports the number of steps and the highest value reached along the way.

It's a famous unsolved problem in mathematics — every number tested so far eventually reaches 1, but no one has proven it's true for all numbers. Math enthusiasts, students, and programmers use this calculator to explore the sequence and see how wildly the peak value can spike before collapsing back down.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators