Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Steps to reach 1 (stopping time)
111
iterations of the 3n+1 rule
Starting number 27
Highest value reached 9,232

What is the Collatz Conjecture?

The Collatz conjecture, also called the 3n+1 problem, is one of the most famous unsolved problems in mathematics. Start with any positive integer. If it is even, divide it by two. If it is odd, multiply it by three and add one. Repeat the process with each new number. The conjecture states that no matter which number you start with, the sequence will eventually reach 1.

Flowchart of one Collatz step branching on even or odd
Each step halves an even number or applies 3n+1 to an odd number.

How to use this calculator

Enter any positive whole number and the tool generates the full Collatz sequence behind the scenes. It reports the stopping time (the number of steps needed to reach 1) and the highest value the sequence climbs to before falling back down. This is a great way to explore how wildly different starting numbers behave.

The formula explained

The rule is defined piecewise: \(f(n) = n/2\) when \(n\) is even, and \(f(n) = 3n + 1\) when \(n\) is odd.

$$f(n) = \begin{cases} \dfrac{n}{2} & \text{if } n \equiv 0 \pmod{2} \\[0.6em] 3n+1 & \text{if } n \equiv 1 \pmod{2} \end{cases} \qquad n_0 = \text{Starting number}$$

Once a value of 1 is reached the sequence enters the loop 1, 4, 2, 1, so the calculator stops counting at 1. The total number of applications of \(f\) needed is the stopping time.

Worked example

Start with 6. It is even, so \(6 \to 3\) (step 1). 3 is odd, so \(3 \to 10\) (step 2). \(10 \to 5\) (step 3), \(5 \to 16\) (step 4), \(16 \to 8\) (step 5), \(8 \to 4\) (step 6), \(4 \to 2\) (step 7), \(2 \to 1\) (step 8). It takes 8 steps and the highest value reached is 16.

Line graph of a Collatz sequence rising and falling toward 1
A typical Collatz trajectory bounces up and down before falling to 1.

FAQ

Has the conjecture been proven? No. It has been verified by computer for enormous ranges of numbers, but no general proof exists.

Why does the sequence sometimes get so large? Odd steps multiply by three, so a run of odd-heavy values can push numbers very high before the halving steps bring them down.

What does stopping time mean? It is simply the count of how many times the rule is applied before the value first equals 1.

Last updated: