Skip to content
Topos Uranos

Prime numbers and the fundamental theorem of arithmetic

Summary

This lesson studies the prime numbers, the atoms of the multiplication of the natural numbers. It proves that every natural number greater than 11 has a prime divisor, presents the sieve of Eratosthenes and the reason why it suffices to sieve up to the square root, and proves with Euclid that the primes are infinitely many. It then proves Euclid’s lemma, according to which a prime that divides a product divides one of its factors, and with it the fundamental theorem of arithmetic: every natural number greater than 11 can be written as a product of primes in exactly one way. From the factorization one derives the number of divisors of a natural number, the characterization of the perfect squares and the irrationality of the square root of every natural number that is not a perfect square.

Learning objectives

  1. Distinguish the prime numbers from the composite ones and prove that every natural number greater than 11 has a prime divisor.
  2. Apply the sieve of Eratosthenes and justify why it suffices to cross out the multiples of the primes not greater than the square root of the bound.
  3. Prove the infinitude of the primes, Euclid’s lemma, and the existence and uniqueness of the factorization into primes.
  4. Use the factorization to count and list divisors, recognize perfect squares and prove the irrationality of square roots.

Prime numbers and composite numbers

In the lesson on divisibility and division with remainder we saw that every natural number nn is divisible by 11 and by itself. Some natural numbers admit no divisors other than those two; they are the pieces from which, by multiplication, all the others are built.

Definition (prime number). A natural number pp is prime if p>1p > 1 and its only divisors are 11 and pp. A natural number n>1n > 1 that is not prime is called composite: it can be written as n=abn = ab, with 1<a<n1 < a < n and 1<b<n1 < b < n. The number 11 is neither prime nor composite.

The primes less than 5050 are the following fifteen:

2,3,5,7,11,13,17,19,23,29,31,37,41,43,472, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47

The number 22 is the only even prime, because every other even number has the divisor 22, which is different from 11 and from the number itself. The exclusion of 11 is not a whim of the definition: if 11 were prime, the factorization into primes would no longer be unique, because 6=2⋅3=1⋅2⋅36 = 2 \cdot 3 = 1 \cdot 2 \cdot 3, and the central theorem of this lesson would have to be stated with an exception.

The well-ordering principle

The proofs of this lesson rest on a form of the principle of induction that is especially convenient for reasoning about divisors: the well-ordering principle, according to which every nonempty set of natural numbers has a least element. It was derived from strong induction in the lesson on summations, progressions and induction, and here it is used without repeating its proof.

Every natural number greater than 1 has a prime divisor

The first result of the lesson ensures that no natural number greater than 11 escapes the primes: there is always one that divides it, and it is found among the smallest divisors.

PropositionThe least divisor greater than 1 is prime

Every natural number n>1n > 1 has a prime divisor: the least divisor of nn greater than 11 is prime. If, moreover, nn is composite, its least prime divisor pp satisfies p2≤np^2 \leq n. The figure marks on the line the divisors of n=91=7⋅13n = 91 = 7 \cdot 13.

Proof

  1. D={d∈N:d∣n∧d>1},n∈D,m=min⁡D\dato{D}{D = \{ d \in \mathbb{N} : d \mid n \wedge d > 1 \}}, \quad n \in D, \quad m = \min D

    The set of the divisors of nn greater than 11 is not empty, because it contains nn itself; by the well-ordering principle, it has a least element mm.

  2. a∣m∧m∣n→a∈D,a<ma \mid m \wedge m \mid n \rightarrow \resaltar{a \in D}, \quad \resaltar{a < m}

    If mm were composite, m=abm = ab with 1<a<m1 < a < m, the factor aa would divide mm and, by the transitivity of divisibility, nn: it would be an element of DD less than mm, contrary to the choice of mm. Therefore, mm is prime.

  3. n=pk,k∈D\dato{k}{n = pk, \quad k \in D}

    Now let nn be composite, and let pp be its least prime divisor, which is the least element of DD. We write n=pkn = pk; since nn is not prime, k≠1k \neq 1, and kk also divides nn.

  4. p2=p⋅p≤p⋅k=np^2 = p \cdot p \leq \resaltar{p \cdot k} = n

    By the minimality of pp, we have k≥pk \geq p, and the monotonicity of multiplication gives the bound.

Therefore, to decide whether a natural number nn is prime it suffices to test the primes pp with p2≤np^2 \leq n: if none of them divides it, nn is prime. For example, for 221221 it suffices to test the primes up to 1313, because 172=289>22117^2 = 289 > 221: it is not divisible by 22, 33, 55, 77 or 1111, but it is divisible by 1313, and 221=13⋅17221 = 13 \cdot 17. On the other hand, 211211 is not divisible by any of the primes 22, 33, 55, 77, 1111 and 1313, and since 172=289>21117^2 = 289 > 211, the number 211211 is prime.