Skip to content

Primes and the Fundamental Theorem of Arithmetic

Definition. An integer p>1p > 1 is prime if its only positive divisors are 11 and pp. An integer n>1n > 1 that is not prime is composite.

1 is neither prime nor composite; a convention that makes unique factorisation statements clean.

Euclid’s lemma (from Divisibility): if pp is prime and p∣abp \mid ab, then p∣ap \mid a or p∣bp \mid b. This fails for composite pp (6∣4⋅96 \mid 4 \cdot 9 but 6∤46 \nmid 4 and 6∤96 \nmid 9), and is precisely what makes primes special.

Theorem. There are infinitely many primes.

Proof. Suppose p1,…,pkp_1, \ldots, p_k are all the primes and consider

N=p1p2⋯pk+1.N = p_1 p_2 \cdots p_k + 1.

N>1N > 1, so it has a prime divisor pp. But no pip_i divides NN (each leaves remainder 1), so pp is a prime not in the list; contradiction. ■\blacksquare

Note the proof gives no efficient method for producing new primes: p1⋯pk+1p_1 \cdots p_k + 1 need not be prime (the products are called Euclid numbers; $2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13

  • 1 = 30031 = 59 \times 509$ is composite).

Theorem (FTA). Every integer n>1n > 1 can be written as a product of primes, and this factorisation is unique up to the order of the factors.

Existence (strong induction): n=2n = 2 is prime. If n>2n > 2 is composite, n=abn = ab with 1<a,b<n1 < a, b < n; each factor factors into primes by induction, so nn does too.

Uniqueness (Euclid’s lemma): suppose

n=p1p2⋯pr=q1q2⋯qsn = p_1 p_2 \cdots p_r = q_1 q_2 \cdots q_s

with primes pi,qjp_i, q_j. Then p1∣q1⋯qsp_1 \mid q_1 \cdots q_s, so p1∣qjp_1 \mid q_j for some jj; both are prime so qj=p1q_j = p_1. Cancel and repeat on the remaining product. The lists match exactly. ■\blacksquare

Canonical form. Collect equal primes:

n=p1e1p2e2⋯pkek,p1<p2<⋯<pk,ei≥1.n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k}, \qquad p_1 < p_2 < \cdots < p_k, \quad e_i \geq 1.
  • gcd⁡\gcd and lcm\mathrm{lcm} from factorisations:
gcd⁡(a,b)=∏pimin⁡(αi,βi),lcm(a,b)=∏pimax⁡(αi,βi),\gcd(a, b) = \prod p_i^{\min(\alpha_i, \beta_i)}, \qquad \mathrm{lcm}(a, b) = \prod p_i^{\max(\alpha_i, \beta_i)},

and always gcd⁡(a,b)⋅lcm(a,b)=∣ab∣\gcd(a,b) \cdot \mathrm{lcm}(a,b) = |ab|.

  • Irrationality of 2\sqrt{2}: if 2=a/b\sqrt{2} = a/b in lowest terms then a2=2b2a^2 = 2b^2, so 2∣a22 \mid a^2, hence 2∣a2 \mid a (Euclid’s lemma); writing a=2ca = 2c gives 4c2=2b24c^2 = 2b^2, so 2∣b2 \mid b; contradicting lowest terms. The same argument works with 2 replaced by any prime, proving p\sqrt{p} irrational for every prime pp.
  • No integer between 0 and 1 is a product of primes: the FTA genuinely fails in systems like Z[−5]\mathbb{Z}[\sqrt{-5}] (6=2⋅3=(1+−5)(1−−5)6 = 2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5})); uniqueness, not existence, is the delicate part.

If n=p1e1⋯pkekn = p_1^{e_1} \cdots p_k^{e_k} then the number of positive divisors is

τ(n)=(e1+1)(e2+1)⋯(ek+1),\tau(n) = (e_1 + 1)(e_2 + 1) \cdots (e_k + 1),

since a divisor chooses an exponent between 0 and eie_i independently for each prime. For example, 720=24⋅32⋅5720 = 2^4 \cdot 3^2 \cdot 5 has (5)(3)(2)=30(5)(3)(2) = 30 divisors.

To list all primes up to NN: write the integers from 2 to NN, circle 2 and cross out all larger multiples of 2; circle the next surviving number and cross out its larger multiples; repeat while the circled number satisfies p≤Np \leq \sqrt{N}. Composites up to NN always have a prime factor ≤N\leq \sqrt{N}, so the survivors are exactly the primes. Cost: O(Nlog⁡log⁡N)O(N \log \log N) operations.

  • 1 is not prime: allowing 11 as a factor would destroy uniqueness of the factorisation.
  • Factorisations must cover negative integers via the sign: −12=−1⋅22⋅3-12 = -1 \cdot 2^2 \cdot 3.
  • The FTA is about the multiset of primes: 12=2⋅2⋅3=3⋅2⋅212 = 2 \cdot 2 \cdot 3 = 3 \cdot 2 \cdot 2 are the same factorisation in different orders.
  • Euclid’s infinitude proof does not say p1⋯pk+1p_1 \cdots p_k + 1 is prime; only that it has a new prime factor.

For exam proofs, write factorisations in canonical ascending-prime form before comparing; order-free multisets earn no method marks unless the canonical form is stated first. Every exam answer should conclude with the canonical form restated: the uniqueness statement is about the multiset of prime factors, not the written order of the product.