Mathwords logoMathwords

Collatz Problem — Definition, Formula & Examples

The Collatz Problem asks whether repeatedly applying a simple rule — if a number is even, halve it; if odd, triple it and add 1 — will always eventually reach 1, no matter which positive integer you start with.

Define the function T(n)T(n) on positive integers by T(n)=n/2T(n) = n/2 if nn is even and T(n)=3n+1T(n) = 3n + 1 if nn is odd. The Collatz conjecture states that for every positive integer nn, there exists some finite kk such that the kk-th iterate T(k)(n)=1T^{(k)}(n) = 1.

Key Formula

T(n)={n/2if n is even3n+1if n is oddT(n) = \begin{cases} n/2 & \text{if } n \text{ is even} \\ 3n+1 & \text{if } n \text{ is odd} \end{cases}
Where:
  • nn = Any positive integer
  • T(n)T(n) = The next value in the Collatz sequence

How It Works

Pick any positive integer. If it is even, divide by 2. If it is odd, multiply by 3 and add 1. Repeat with the result. The sequence you generate is called the Collatz sequence (or hailstone sequence) for that starting number. The conjecture claims every such sequence eventually hits 1, then cycles through 4, 2, 1 forever. Despite its simple statement, no one has proven this is true for all integers — it remains one of the most famous open problems in mathematics.

Worked Example

Problem: Find the Collatz sequence starting at n = 6.
Start: Begin with 6. It is even, so divide by 2.
636 \to 3
Step 1: 3 is odd, so compute 3(3) + 1 = 10.
3103 \to 10
Step 2: 10 is even, so divide by 2. Then continue: 5 is odd, 16 is even, and keep halving.
10516842110 \to 5 \to 16 \to 8 \to 4 \to 2 \to 1
Answer: The full sequence is 6, 3, 10, 5, 16, 8, 4, 2, 1. It reaches 1 in 8 steps.

Why It Matters

The Collatz Problem is a gateway into number theory and mathematical reasoning because it shows how simple rules can produce wildly unpredictable behavior. It has been verified by computer for all starting values up to at least 2682^{68}, yet a general proof remains elusive. Mathematician Paul Erdős famously said that mathematics is "not yet ready" for problems like this one.

Common Mistakes

Mistake: Applying the odd rule to even numbers or vice versa.
Correction: Always check parity first. Divide by 2 only when nn is even; apply 3n+13n + 1 only when nn is odd.