The Collatz Conjecture

The Collatz Conjecture, also called the 3n+1 problem, is one of the best-known unsolved riddles in mathematics. The rules are simple enough for a child. A general proof has eluded the world's best mathematicians.

A geometric Collatz tree grown from hailstone sequences
A geometric Collatz tree grown from hailstone sequences

The rules

Choose any positive integer n and apply two rules again and again. If the number is even, divide it by 2. If the number is odd, multiply it by 3 and add 1. The conjecture says that every starting value eventually reaches 1. At 1 you fall into an infinite loop: 1 → 4 → 2 → 1.

An example: start at 6

6 is even, so 6/2 = 3. 3 is odd, so 3×3+1 = 10. Then 10 → 5 → 16 → 8 → 4 → 2 → 1. The values shoot up and down before they collapse, which is why these sequences are also called hailstone numbers.

Why it is so hard

Computers have checked every integer far past 2×10²¹, and each one ends at 1. A watertight proof is still missing. Paul Erdős once said that mathematics is simply not ready for this kind of problem. In 2019 Terence Tao proved that the conjecture holds for almost all numbers — a major breakthrough that still leaves the absolute case open. A Japanese company has offered a prize of 120 million yen (about €750,000) for a definitive solution.

Method 1: the geometric tree

Instead of plotting n against step count, treat the sequence as navigation on the plane. Each point has a position (x, y) and a heading θ. A step of length L moves x' = x + L cos θ and y' = y + L sin θ, and L shrinks as the numbers grow, in proportion to n / (1 + n^1.3), so high climbs curl up into fronds. The next heading depends on parity: even numbers turn by a small angle α, odd numbers turn the other way by β. Designers often choose α ≠ β — for example α = 0.15 and β = 0.28 — because a typical sequence has more even steps than odd ones, and the imbalance gives the coral its organic curl. Grow many sequences from 1, or walk backwards from the trunk at 1 toward the leaves.

Method 2: the complex Collatz fractal

The usual Collatz map is discrete. To paint a Mandelbrot-style fractal you need a smooth function on the whole complex plane. A trigonometric switch does that: f(z) = (z/2) cos²(πz/2) + (3z+1) sin²(πz/2) On an even integer, cos² = 1 and sin² = 0, so f reduces to z/2. On an odd integer the weights swap and f reduces to 3z+1. Sine and cosine are defined between the integers as well, so every pixel z0 = x + yi can be iterated. Colour records how many steps it takes for |z| to escape a radius R. The infinitely detailed boundary between escape and capture is the fractal.

Explore it in PictorX

Open Collatz Conjecture to grow hailstone corals, walk a single sequence, or zoom the continuous fractal in your browser. Tune the turn angles, pick a starting number, change the palette, and save a PNG. Pair it with Fractal Generator or Lorenz Attractor for more mathematical play.

Frequently asked questions

Who stated the Collatz Conjecture?

Lothar Collatz circulated the 3n+1 problem in the 1930s. It is also called the Ulam conjecture, the Kakutani problem, and the hailstone problem.

Is every number known to reach 1?

Every integer that has been checked does, including values far above 2×10²¹. That is strong evidence, not a proof that every integer does.

What did Terence Tao prove?

In 2019 he showed that almost all starting values eventually become smaller than any given function that goes to infinity, however slowly. That is close to the conjecture, but it still allows exceptional numbers.

How is the Collatz fractal built?

A trigonometric formula agrees with n/2 and 3n+1 on the integers and stays smooth everywhere else. Iterating it on complex starting points and colouring by escape time produces the fractal.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Try Collatz Conjecture