← back to Number Theory

Primes

Jim Hefferon · Elementary Number Theory · Ch. 2

A prime is an integer greater than 1 whose only positive divisors are 1 and itself. Every integer greater than 1 factors uniquely into primes. There are infinitely many of them.

Fundamental theorem of arithmetic

Every integer n > 1 can be written as a product of primes, and this factorization is unique up to the order of factors. This is the structural backbone of number theory: the primes are the atoms.

Scheme

Infinitude of primes (Euclid's proof)

Suppose there are only finitely many primes p1, p2, ..., pn. Consider N = p1 p2 ... pn + 1. No pi divides N (each leaves remainder 1). So N has a prime factor not in the list. Contradiction. Therefore, there are infinitely many primes.

Scheme

Sieve of Eratosthenes

To find all primes up to n: list 2 through n, then cross out multiples of 2 (keeping 2), multiples of 3 (keeping 3), and so on. Whatever remains is prime. You only need to sieve up to the square root of n.

Cross out multiples of 2, then 3, then 5... 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Scheme
Neighbors
  • → Cryptography Ch.6 — RSA encryption relies on the difficulty of factoring large numbers into primes