Unique prime factorization
Prove that positive integers have one prime structure, then use exponents to compute divisibility information.
On this page
The question for today
What you’ll understand
- Separate the existence and uniqueness parts of prime factorization.
- Derive Euclid’s lemma from Bézout coefficients.
- Use prime exponents to compute gcds, lcms, and divisor counts.
Factoring an integer is more than finding a convenient multiplication. The fundamental theorem of arithmetic says that every integer greater than one is built from primes in one way, apart from rearranging the factors. This lets prime exponents act as coordinates for positive integers. The theorem has two separate responsibilities: a decomposition must exist, and a competing decomposition cannot differ. Understanding their proofs also shows why one cannot casually assume the same theorem in every arithmetic system.
Existence comes from descent
A prime is a positive integer greater than one whose only positive divisors are one and itself. An integer greater than one that is not prime has a factorization into two smaller positive integers greater than one. Applying this observation repeatedly must stop, because the factors strictly decrease along any unfinished branch. Equivalently, strong induction on the integer proves existence of a finite product of primes.
The integer one is excluded from the primes for a structural reason: inserting extra factors of one would destroy a useful uniqueness statement. We treat one as the empty product, with all prime exponents zero. Negative integers require an additional sign; zero does not have a finite prime factorization of this form. State this domain before using exponent notation, rather than assuming that all integers fit the same representation.
Uniqueness uses a prime-divisor lemma
The essential lemma says that if a prime p divides ab, it divides a or b. If p does not divide a, their gcd is one, so Bézout gives pu + av = 1. Multiplying by b shows b = pub + abv. Both terms on the right are divisible by p, proving that p divides b. This argument reveals the role of primality instead of treating the lemma as obvious.
Now compare two prime factorizations of the same positive integer. The first prime in one product divides the other product, so repeated use of the lemma forces it to divide one of the other prime factors. A prime dividing a prime must equal it. Cancel the matching factors in ordinary integer arithmetic and repeat. The products eventually contain exactly the same prime factors with the same multiplicities; their written order is irrelevant.
Exponents turn multiplication into bookkeeping
A positive divisor of n chooses, independently for each prime p, an exponent between zero and vₚ(n). Hence the number of positive divisors is the product of the quantities vₚ(n) + 1. This counting argument counts choices of exponents, not distinct primes alone. For a square, every prime exponent is even; multiplying two numbers adds corresponding exponents, which makes many parity arguments nearly automatic.
Unique factorization is a theorem about ordinary integers, not a promise that factoring large integers is computationally easy. Euclid computes a gcd without obtaining prime coordinates at all. Different tasks call for different representations: a factorization makes divisor structure transparent, while a remainder chain is often cheaper for a gcd. In more general rings, analogues of primes and irreducibles can behave differently; the proof here identifies the lemma that would need to survive.
Work it through
Read three answers from two factorizations
Let a = 360 and b = 252. Find their gcd, lcm, and the number of positive divisors of a.
Factor using small primes: 360 = 2³ × 3² × 5 and 252 = 2² × 3² × 7. Check the products to ensure that no multiplicity has been lost.
Take minimum exponents to obtain gcd = 2² × 3² = 36. Take maximum exponents to obtain lcm = 2³ × 3² × 5 × 7 = 2520; both original numbers divide that result.
A divisor of 360 chooses four possible powers of 2, three powers of 3, and two powers of 5. Multiplying independent choices gives 4 × 3 × 2 = 24 positive divisors.
The gcd is 36, the lcm is 2520, and 360 has 24 positive divisors; 36 × 2520 = 360 × 252 checks the first two answers.
The living notebook
Explore the model
Interactive lab · function
Squares and even multiplicities
Set coefficient a to one and compare positions x = 1 and x = 2. Predict the quadratic outputs, then factor 1 and 4 by hand. Squaring doubles prime exponents when the input is an integer. The lab plots the real curve y = ax² and its tangent and area; it does not factor integers or test primality.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA continuous square curve supports a discrete exponent rule only after restricting its inputs to integers.
Pause & reason
Check your understanding
Your turn
Try it yourself
Suppose positive integers a and b are coprime and ab is a perfect square. Prove that each of a and b is a perfect square.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Track a prime exponent and use coprimality to decide which factor can contain it.
Compare with the solution
For each prime p, the exponent in ab is the sum of its exponents in a and b and is even because ab is a square. Coprimality says at most one of those two exponents is positive. Consequently the nonzero exponent, if any, must itself be even. Every prime exponent in a and in b is therefore even, so halving those exponents constructs integer square roots of both factors. Without coprimality the statement fails, for example a = b = 2.
Keep the idea
Take it with you
- Prime factorization requires both existence and uniqueness arguments.
- Euclid’s lemma follows from coprimality and a Bézout identity.
- Prime exponents organize divisors, gcds, lcms, and perfect powers.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.