Collatz Conjecture Calculator

Generate the Collatz (3n + 1) sequence for any start number, with the number of steps, the peak value and the full path. The map is n → n/2 if n is even and n → 3n + 1 if n is odd. Example: with starting number 27, the result is Steps to reach 1 = 111.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

How do you use the Collatz Conjecture Calculator?

Enter a positive whole number. The calculator applies the Collatz rule repeatedly (halve if even, triple plus one if odd) until it reaches 1, then reports the number of steps, the highest value, the count of even and odd steps and the sequence itself.

What formula does the Collatz Conjecture Calculator use?

The map is n → n/2 if n is even and n → 3n + 1 if n is odd. The Collatz conjecture, posed by Lothar Collatz in 1937, asserts that every positive starting value eventually reaches 1. It has been verified by computer for every start up to roughly 2⁶⁸ but remains unproven.

Worked example: Starting number 27

Starting at 27, the sequence needs 111 steps and climbs as high as 9,232 before falling to 1. By contrast, 16 reaches 1 in just 4 steps: 16 → 8 → 4 → 2 → 1.

With the default values the calculator returns Steps to reach 1 = 111; Highest value reached = 9232; Sequence = 27 → 82 → 41 → 124 → 62 → 31 → 94 → 47 → 142 → 71 → 214 → 107 → 322 → 161 → 484 → 242 → 121 → 364 → 182 → 91 → 274 → 137 → 412 → 206 → 103 → 310 → 155 → 466 → 233 → 700 → 350 → 175 → 526 → 263 → 790 → 395 → 1186 → 593 → 1780 → 890 → 445 → 1336 → 668 → 334 → 167 → 502 → 251 → 754 → 377 → 1132 → 566 → 283 → 850 → 425 → 1276 → 638 → 319 → 958 → 479 → 1438 → …; Even steps / odd steps = 70 even / 41 odd.

Where Is This Calculation Used?

The Collatz problem is a famous example of a question that is easy to state and extremely hard to settle. Exploring starts shows “hailstone” behaviour: values rise and fall unpredictably, yet always seem to collapse to the 4 → 2 → 1 loop. Computing step counts is a classic programming exercise.

What are the most common mistakes with the Collatz Conjecture Calculator?

  • Using n/2 on odd numbers or 3n + 1 on even numbers.
  • Expecting a sequence to be monotonic; it rises and falls.
  • Treating the conjecture as proven because no counterexample has been found.

What Is the Tested Example for the Default Values?

This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.

Input: Starting number27
Steps to reach 1111
Highest value reached9232
Sequence27 → 82 → 41 → 124 → 62 → 31 → 94 → 47 → 142 → 71 → 214 → 107 → 322 → 161 → 484 → 242 → 121 → 364 → 182 → 91 → 274 → 137 → 412 → 206 → 103 → 310 → 155 → 466 → 233 → 700 → 350 → 175 → 526 → 263 → 790 → 395 → 1186 → 593 → 1780 → 890 → 445 → 1336 → 668 → 334 → 167 → 502 → 251 → 754 → 377 → 1132 → 566 → 283 → 850 → 425 → 1276 → 638 → 319 → 958 → 479 → 1438 → …
Even steps / odd steps70 even / 41 odd

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

What is the Collatz conjecture?

The claim that repeatedly halving even numbers and replacing odd n by 3n + 1 always reaches 1, whatever positive number you start with.

How many steps does 27 take?

111 steps, with a maximum value of 9,232.

Has the Collatz conjecture been proven?

No. It is checked for all starting values up to about 2⁶⁸, but there is no proof.