The Fundamental Theorem of Arithmetic

Every substance in chemistry breaks down into a unique combination of elements — water is always \text{H}_2\text{O}, never anything else. Whole numbers work the same way, with primes playing the role of elements. Take 60. Break it apart by dividing out primes and you get

60 = 2 \times 2 \times 3 \times 5 = 2^2 \times 3 \times 5.

Try it a completely different way — split 60 as 6 \times 10 instead of 4 \times 15, say — and keep breaking the pieces down. You will always land on 2^2 \times 3 \times 5, never any other combination of primes. The Fundamental Theorem of Arithmetic is the statement that this always happens: every whole number bigger than 1 has one, and only one, "chemical formula" in primes. It is a fact so basic that we lean on it without noticing, yet it is the bedrock the whole of number theory is built on.

You already rely on it constantly. When you cancel a fraction like \tfrac{18}{24} down to \tfrac{3}{4}, you're trusting that 18 = 2\times 3^2 and 24 = 2^3\times 3 have one fixed set of shared prime factors to cancel — if numbers could be factored several genuinely different ways, "the" simplest form of a fraction might not even exist, and two people simplifying the same fraction by different routes could land on two different, equally "correct" answers. Unique factorisation is what makes a reduced fraction an honest, unambiguous thing.

The statement

Every integer n > 1 can be written as a product of primes,

n = p_1^{a_1}\, p_2^{a_2} \cdots p_k^{a_k},

and this factorisation is unique apart from the order of the factors.

Two separate claims live inside that one sentence, and both matter:

We meet prime factorisation early in school as a procedure — a tree of branches ending in primes. This theorem is the guarantee that the procedure can only ever give one answer, however you draw the tree.

Worked example: factor a few numbers

Factorising is just repeated division by the smallest prime that fits. Take 84:

84 = 2\times 42 = 2\times 2\times 21 = 2^2 \times 3 \times 7.

Now a slightly bigger one, 360:

360 = 2\times 180 = 2^2\times 90 = 2^3\times 45 = 2^3\times 3^2\times 5.

No matter which prime you happen to divide out first, the exponents you end up with — 2^3, 3^2, 5^1 — are always the same for 360. Try starting from 360 = 8\times 45 instead of 2\times 180: you still finish at 2^3\times 3^2\times 5. That's uniqueness, working quietly in the background every time.

Worked example: GCD and LCM by comparing exponents

Once two numbers are written in prime-power form, their greatest common divisor and least common multiple fall out almost for free — no guessing, no long lists of divisors. Take 84 = 2^2 \times 3 \times 7 and 360 = 2^3 \times 3^2 \times 5. Line up every prime that appears in either number, using exponent 0 where a prime is missing:

84 = 2^2\times 3^1\times 5^0\times 7^1,\qquad 360 = 2^3\times 3^2\times 5^1\times 7^0.

The GCD takes the smaller exponent of each prime (the most either number can share), and the LCM takes the larger exponent of each prime (the least that is a multiple of both):

\gcd(84, 360) = 2^{\min(2,3)}\times 3^{\min(1,2)}\times 5^{\min(0,1)}\times 7^{\min(1,0)} = 2^2\times 3 = 12. \operatorname{lcm}(84, 360) = 2^{\max(2,3)}\times 3^{\max(1,2)}\times 5^{\max(0,1)}\times 7^{\max(1,0)} = 2^3\times 3^2\times 5\times 7 = 2520.

This "min and max of exponents" shortcut is only legal because the Fundamental Theorem guarantees each number has one true prime signature to compare in the first place — without uniqueness, "the" exponent of 3 in 84 wouldn't even be a well-defined thing to talk about.

A third payoff: counting divisors without listing them

The same exponents unlock yet another shortcut. Every divisor of n = p_1^{a_1} p_2^{a_2}\cdots p_k^{a_k} is built by picking, for each prime, an exponent somewhere between 0 and its maximum a_i — there are a_i + 1 choices for that one prime (including "leave it out," exponent 0), and the choices for different primes are completely independent. Multiply the counts together:

d(n) = (a_1+1)(a_2+1)\cdots(a_k+1).

For 360 = 2^3\times 3^2\times 5^1 that gives d(360) = (3+1)(2+1)(1+1) = 4\times 3\times 2 = 24 divisors — and indeed, listing them out (1, 2, 3, 4, 5, 6, 8, 9, 10, 12, \dots, 360) really does stop at exactly 24 numbers. No list-making required, just the exponents — and once again, the whole trick only works because those exponents are the one true set guaranteed by unique factorisation, not one of several possible sets.

Existence is the easy half

Take any n > 1. Either it is prime (done), or it splits as n = ab with both factors smaller. Repeat on the factors. Because the pieces keep shrinking and cannot drop below 2, the process must stop — and it stops only when every piece is prime. So a factorisation always exists. This half is almost obvious once you see it; the real content of the theorem is the other half.

Uniqueness is the deep half

Uniqueness hinges on one crucial property of primes, Euclid's lemma:

If a prime p divides a product ab, then p divides a or p divides b.

This is exactly where Bézout's identity earns its keep: if p \nmid a then \gcd(p, a) = 1, so px + ay = 1; multiply by b and both terms are divisible by p, forcing p \mid b. Euclid's lemma is what stops two genuinely different prime factorisations from ever existing for the same number — without it, unique factorisation would simply be false (as it is in some larger number systems we'll meet in algebraic number theory).

The uniqueness proof itself runs by contradiction: suppose some number had two genuinely different prime factorisations, and take the smallest such number, n. A prime p_1 from the first factorisation must, by Euclid's lemma, divide one of the primes in the second factorisation — but a prime only divides another prime if they are equal. Cancel that shared prime from both sides and you get a smaller number with two different factorisations, contradicting the choice of n as the smallest offender. No smallest counterexample can exist, so no counterexample exists at all.

It looks harmless enough — 1 only divides itself, so why not call it prime? Because doing so would smash uniqueness to pieces. If 1 counted as a prime, then

60 = 2^2\times 3\times 5 = 2^2\times 3\times 5\times 1 = 2^2\times 3\times 5\times 1\times 1 = \cdots

would all be valid, different, prime factorisations of the exact same number 60 — infinitely many of them, just by stapling on more copies of 1. The theorem's promise of a single, unique factorisation would instantly collapse. So mathematicians define 1 as neither prime nor composite — a special case sitting outside the whole system, precisely so that "the" prime factorisation of every other number stays a meaningful, one-and-only-one thing to talk about. It is a definition chosen for convenience and consistency, not an accident of history.

Why uniqueness matters

Notice how much silently depends on there being exactly one right answer, not merely an answer. The "min and max of exponents" trick for \gcd and \operatorname{lcm} above only makes sense because each number has one true set of exponents to compare. The proof that \sqrt 2 is irrational leans on it too: if \sqrt 2 = a/b in lowest terms, squaring gives a^2 = 2b^2, and comparing the number of times 2 divides each side — which only makes sense because factorisations are unique — forces a contradiction. Nearly every argument later in this subject quietly assumes that a number's prime factorisation is the factorisation, not just a factorisation among several. If uniqueness failed, "the number of times 2 divides n" wouldn't even be a well-defined question to ask.

There's a security payoff too. Modern encryption (the padlock icon that protects a card payment online) leans on the flip side of this same fact: it is easy to multiply two large primes together, but — as far as anyone has ever managed to prove or disprove — brutally hard to run the process backwards and recover the two primes from their product alone. Unique factorisation guarantees there's only one correct pair to find; it just doesn't promise anyone an efficient way to find it. That gap between "exists uniquely" and "easy to compute" is precisely what keeps that padlock locked.

Here's the surprise: something this intuitive is not automatic. Euclid already had the key lemma over two thousand years ago, but a fully careful statement and proof of unique factorisation, in the form used today, wasn't nailed down until Carl Friedrich Gauss's Disquisitiones Arithmeticae in 1801. And once mathematicians pushed the idea into larger number systems, it broke completely. In the numbers \mathbb{Z}[\sqrt{-5}] = \{a + b\sqrt{-5} : a, b \in \mathbb{Z}\}, the number 6 factors two genuinely different ways:

6 = 2\times 3 = (1+\sqrt{-5})(1-\sqrt{-5}),

and none of 2, 3, 1+\sqrt{-5}, 1-\sqrt{-5} can be broken down any further in that system — yet the two factorisations don't match. Even the friendlier Gaussian integers, which do keep unique factorisation, need real work to prove it. The ordinary whole numbers you grew up with are, in this precise sense, unusually well-behaved — unique factorisation is a gift, not a given.

See it explained