1 is not prime, by decision
Because uniqueness of factorisation would fail: 6 = 2·3 = 1·2·3 = 1·1·2·3. The definition is chosen to make the theorem true.
The fundamental theorem of arithmetic. Primes are the multiplicative atoms, there are infinitely many, and the uniqueness of the factorisation is what makes almost every later argument possible.
Core ideas
Existence of a factorisation is easy; uniqueness is the theorem, and it is what everything else uses.
Because uniqueness of factorisation would fail: 6 = 2·3 = 1·2·3 = 1·1·2·3. The definition is chosen to make the theorem true.
Existence follows from strong induction in three lines. Uniqueness needs Euclid's lemma, which needs Bézout.
A composite n has a factor at most √n, so testing beyond that is unnecessary — and it is why the sieve of “The Sieve of Eratosthenes” stops where it does.
The material
The definition, both halves of the fundamental theorem, and Euclid's proof.
An integer p > 1 is prime if its only positive divisors are 1 and p. An integer n > 1 that is not prime is composite. The number 1 is neither.
Excluding 1 is a convention chosen to make the fundamental theorem clean. If 1 were prime, 6 would factor as 2·3, 1·2·3, 1·1·2·3 and so on, and uniqueness would need an awkward qualification.
Every integer n > 1 can be written as a product of primes, and the factorisation is unique up to the order of the factors.
Existence, by strong induction (“Strong Induction” in Induction and Recursion). If n is prime it is a product of one prime. Otherwise n = ab with 1 < a, b < n, and by the inductive hypothesis both factor into primes; concatenating the two factorisations gives one for n.
Uniqueness requires Euclid's lemma (“Bézout's Identity and Modular Inverses”): if a prime p divides ab then p | a or p | b. Given two factorisations of n, the first prime of one divides the product forming the other, hence divides one of its primes, hence equals it. Cancelling and repeating matches the factorisations term by term.
□
Uniqueness is not obvious and it is not universal. In the number system {a + b√−5} the number 6 factors as 2 · 3 and as (1 + √−5)(1 − √−5), with all four factors irreducible. Unique factorisation is a property of ℤ, and it is what Number Theory and Cryptography relies on throughout.
For any finite list of primes there is a prime not on it.
Given primes p₁, …, p_k, let N = p₁p₂⋯p_k + 1. Since N > 1 it has a prime factor q.
If q were some pᵢ, it would divide both p₁⋯p_k and N, hence their difference 1 — impossible for a prime. So q is not on the list.
□
N itself need not be prime: 2·3·5·7·11·13 + 1 = 30031 = 59 · 509. The proof produces a prime not on the list, not necessarily N, and misremembering that is the standard error.
If n > 1 is composite, it has a prime factor p ≤ √n.
Write n = ab with 1 < a ≤ b < n. If both exceeded √n their product would exceed n, so a ≤ √n. Any prime factor of a is a prime factor of n and is at most a ≤ √n.
□
So testing 101 for primality needs only the primes up to 10: 2, 3, 5, 7. None divides it, so it is prime. That is four divisions rather than ninety-nine.
There are 25 primes below 100, 168 below 1000, and 78 498 below a million. The prime number theorem says the count below n is approximately n / ln n, so primes thin out slowly — near 10¹⁰⁰ roughly one number in 230 is prime. That density is what makes RSA key generation practical: random large numbers can be tested until one is prime.
Interactive
Algorithms with their traces
Method
Small primes first, stop at the square root.
2, then 3, then 5, and so on, taking each as many times as it goes.
Whatever is left is then prime. This is the bound above, and it is what keeps hand factorisation feasible.
If n = p₁^{e₁}⋯p_k^{e_k} then n has (e₁+1)⋯(e_k+1) positive divisors, since each exponent is chosen independently from 0 to eᵢ.
If none divides, it is prime. For large numbers this is hopeless and probabilistic tests are used instead.
Trial division, then the divisor formula.
The divisor count is a product rule application: a divisor is determined by choosing an exponent for each prime independently, from 0 up to its exponent in n. “The Sum and Product Rules” in Combinatorics and Counting is doing the work, and the fundamental theorem is what guarantees the choice determines the divisor uniquely.
Factor 2520 completely and predict its divisor count from the exponents before listing anything. 2520 = 2³·3²·5·7, so there are 4·3·2·2 = 48 divisors.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.