Skip to content

Unique Prime Factorization

The fundamental theorem of arithmetic states that every integer $n>1$ can be written as a product of prime numbers, and that this product is unique up to the order of the factors.

Statement of the Theorem

The fundamental theorem of arithmetic states that every integer n>1n>1 can be written as a product of prime numbers, and that this product is unique up to the order of the factors.

Thus every integer n>1n>1 has a representation

n=p1p2pk, n=p_1p_2\cdots p_k,

where each pip_i is prime.

The same factorization is often written by grouping equal primes:

n=p1α1p2α2prαr, n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r},

where

p1<p2<<pr p_1<p_2<\cdots<p_r

are distinct primes and

αi1. \alpha_i\ge1.

For example,

360=23325. 360=2^3\cdot3^2\cdot5.

This means that the multiplicative structure of 360360 is completely determined by the primes 22, 33, and 55, together with their exponents.

Existence of Factorization

We first prove that every integer n>1n>1 can be written as a product of primes.

If nn is prime, then there is nothing to prove. It is already a product of one prime.

If nn is composite, then

n=ab n=ab

for some integers a,ba,b satisfying

1<a<n,1<b<n. 1<a<n, \qquad 1<b<n.

If aa and bb are prime, then nn is a product of primes. If one of them is composite, factor it again. Since each factor is smaller than nn, this process cannot continue forever.

A formal proof uses strong induction. Assume every integer mm with

2m<n 2\le m<n

has a prime factorization. If nn is composite, write

n=ab n=ab

with 1<a,b<n1<a,b<n. By the induction hypothesis, both aa and bb have prime factorizations. Multiplying these factorizations gives a prime factorization of nn.

Thus every integer greater than 11 has at least one prime factorization.

Euclid’s Lemma

The uniqueness part rests on Euclid’s lemma.

If pp is prime and

pab, p\mid ab,

then

pa p\mid a

or

pb. p\mid b.

To prove this, suppose

pa. p\nmid a.

Since pp is prime, the only positive divisors of pp are 11 and pp. Hence

gcd(p,a)=1. \gcd(p,a)=1.

Because

pab p\mid ab

and gcd(p,a)=1\gcd(p,a)=1, the coprimality result from the previous section gives

pb. p\mid b.

Thus a prime dividing a product must divide one of the factors.

By repeated application, if

pa1a2ak, p\mid a_1a_2\cdots a_k,

then pp divides at least one factor aia_i.

Uniqueness of Factorization

Suppose an integer n>1n>1 has two prime factorizations:

n=p1p2pr n=p_1p_2\cdots p_r

and

n=q1q2qs, n=q_1q_2\cdots q_s,

where all pip_i and qjq_j are prime.

Since

p1n, p_1\mid n,

we have

p1q1q2qs. p_1\mid q_1q_2\cdots q_s.

By Euclid’s lemma, p1p_1 divides one of the primes qjq_j. Since qjq_j is prime, its only positive divisors are 11 and qjq_j. Therefore

p1=qj. p_1=q_j.

Cancel this common prime from both factorizations. Repeating the argument, every prime on the left matches one prime on the right.

Thus the two factorizations contain exactly the same primes with exactly the same multiplicities, possibly written in a different order.

This proves uniqueness.

Canonical Form

The uniqueness theorem allows each integer n>1n>1 to be written in canonical form:

n=i=1rpiαi, n=\prod_{i=1}^{r} p_i^{\alpha_i},

where the primes are distinct and ordered:

p1<p2<<pr, p_1<p_2<\cdots<p_r,

and the exponents are positive integers.

For example,

756=22337. 756=2^2\cdot3^3\cdot7.

This form is canonical because no choices remain once the primes are ordered increasingly.

Divisibility in Prime Exponents

Prime factorization turns divisibility into comparison of exponents.

Suppose

a=piαi a=\prod p_i^{\alpha_i}

and

b=piβi, b=\prod p_i^{\beta_i},

where missing primes are assigned exponent 00. Then

ab a\mid b

if and only if

αiβi \alpha_i\le \beta_i

for every prime pip_i.

For example,

12=223 12=2^2\cdot3

and

180=22325. 180=2^2\cdot3^2\cdot5.

Since the exponent of 22 in 1212 is at most that in 180180, and the exponent of 33 in 1212 is at most that in 180180, we have

12180. 12\mid180.

GCD and LCM from Factorization

Prime factorization also gives compact formulas for greatest common divisors and least common multiples.

If

a=piαi a=\prod p_i^{\alpha_i}

and

b=piβi, b=\prod p_i^{\beta_i},

then

gcd(a,b)=pimin(αi,βi) \gcd(a,b)=\prod p_i^{\min(\alpha_i,\beta_i)}

and

lcm(a,b)=pimax(αi,βi). \operatorname{lcm}(a,b)=\prod p_i^{\max(\alpha_i,\beta_i)}.

Thus the gcd takes common prime powers with smaller exponents, while the lcm takes all prime powers with larger exponents.

This gives another proof of the identity

gcd(a,b)lcm(a,b)=ab \gcd(a,b)\operatorname{lcm}(a,b)=ab

for positive integers aa and bb.

Role in Number Theory

Unique prime factorization is the structural foundation of elementary number theory. It says that primes are the irreducible multiplicative components of the positive integers.

Many arithmetic questions become simpler after translating them into prime exponents. Divisibility, gcds, lcms, reduced fractions, divisor counts, and multiplicative functions all rely on this theorem.

The theorem also marks a boundary. In the ordinary integers, factorization into primes is unique. In more general rings, unique factorization may fail. Understanding that failure leads to ideals, Dedekind domains, class groups, and algebraic number theory.