Proof

Suppose this were not the case. That is, suppose there are only finitely many primes. Then there must be a last, largest prime, call it \(p\text{.}\) Consider the number

\begin{equation*} N = p! + 1 = (p \cdot (p-1) \cdot \cdots 3\cdot 2 \cdot 1) + 1\text{.} \end{equation*}

Now \(N\) is certainly larger than \(p\text{.}\) Also, \(N\) is not divisible by any number less than or equal to \(p\text{,}\) since every number less than or equal to \(p\) divides \(p!\text{.}\) Thus the prime factorization of \(N\) contains prime numbers (possibly just \(N\) itself) all greater than \(p\text{.}\) So \(p\) is not the largest prime, a contradiction. Therefore there are infinitely many primes.

in-context