i  ·  xiii
A Treatise on

Number
Theory

The Queen of Mathematics
2 3
“Mathematics is the queen of the sciences, and number theory is the queen of mathematics.”
— C. F. Gauss
Chapter IThe Integers

§1. The playing field

The Integers


The integers ℤ = { … , −3, −2, −1, 0, 1, 2, 3, … } form the bedrock of arithmetic — discrete, unbounded, equipped with addition and multiplication.

−3 −2 −1 0 1 2 3

Positive   the natural numbers,

Negative   their additive inverses

Zero   the still center, an Indian gift to algebra

Every non-empty subset of has a least element.
Chapter IIPrimes

§2. The atoms of arithmetic

The Primes are Infinite


A prime p > 1 has no divisors save 1 and itself. The first few:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, …

There exist infinitely many primes.
Suppose, for contradiction, that the primes are finite: p₁, p₂, …, pn. Form N = p₁·p₂·⋯·pn + 1. Then N is divisible by some prime q. But q cannot equal any pi, for that would imply q ∣ 1. So q is a new prime — contradicting our list.

A proof of crystalline economy — twenty-three centuries old, and still untouched.

Chapter IIIUnique Factorisation

§3. The fundamental theorem

Every Integer is Prime, Uniquely


Every integer n > 1 may be written as a product of primes n = p₁a₁ · p₂a₂ · ⋯ · pkak, and this factorisation is unique up to order.

Examples — the unique decompositions:

12 = 2² · 3
360 = 2³ · 3² · 5
1001 = 7 · 11 · 13
2026 = 2 · 1013
360 8 45 2 4 2 2 5 9 3 3 2 · 2 · 2 · 3 · 3 · 5
Fig. 1The factor tree of 360.
Chapter IVFinding Primes

§4. The sieve and its descendants

How to Catch a Prime


Eratosthenes, c. 240 B.C. — the librarian of Alexandria. Strike out multiples of 2, then 3, then 5… what remains is prime.

Trial Division — test divisors up to √n. Honest, slow.

Miller–Rabin, 1976 — a probabilistic test exploiting Fermat's little theorem. Practically certain in microseconds.

AKS, 2002 — deterministic polynomial-time primality. A theoretical jewel.

1 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
Fig. 2The sieve to 30, with an Ulam spiral.
Chapter VDistribution

§5. The density of primes

The Prime Number Theorem


Let π(n) denote the number of primes ≤ n. The primes thin out — but with breathtaking regularity.

As n → ∞,
π(n) ~ n / ln(n)
that is, π(n) · ln(n) / n → 1.
n π(n) n / ln(n) π(n) 10 10³ 10⁶
Fig. 3The prime counting function π(n) against its smooth approximation.
Chapter VICongruences

§6. Clock arithmetic

Modular Arithmetic


Two integers are congruent modulo n if their difference is divisible by n:

a ≡ b (mod n) ⟺ n ∣ (a − b)

So 17 ≡ 5 (mod 12) — both have remainder 5 when divided by 12. Time, days of the week, hours on a clock: all modular.

Gauss formalised the notation in his 1801 masterwork Disquisitiones Arithmeticae, written at age 24 — and the subject was reborn.

12 1 2 3 4 5 6 7 8 9 10 11
Fig. 4ℤ/12ℤ: the clock.
Chapter VIIFermat

§7. A jewel of congruence

Fermat's Little Theorem


Let p be prime. For every integer a,
ap ≡ a  (mod p)
Equivalently, if gcd(a,p)=1, then ap−1 ≡ 1 (mod p).

A small theorem with vast consequences. It underlies:

  • The Miller–Rabin probabilistic primality test.
  • The correctness of the RSA cryptosystem.
  • Euler's generalisation: aφ(n) ≡ 1 (mod n).

Fermat scribbled it in a letter; the first published proof came from Euler, a century later.

Chapter VIIIDiophantus

§8. Equations in integers

Diophantine Equations


A Diophantine equation demands integer solutions. The simplest non-trivial example:

x² + y² = z²

Pythagorean triples(3,4,5), (5,12,13), (8,15,17), (7,24,25), … infinitely many, all generated by

x = m²−n²,   y = 2mn,   z = m²+n²

for coprime m > n > 0 of opposite parity.

a = 3 b = 4 c = 5 3² + 4² = 5² 9 + 16 = 25
Fig. 5The (3,4,5) Pythagorean triple.
Chapter IXFermat's Last Theorem

§9. Three and a half centuries

Fermat's Last Theorem


For any integer n > 2, the equation
xn + yn = zn
has no solutions in positive integers x, y, z.

Fermat wrote in the margin of his Diophantus:

“Cuius rei demonstrationem mirabilem sane detexi, hanc marginis exiguitas non caperet.” — I have discovered a truly marvellous proof of this, which this margin is too narrow to contain.

It withstood Euler, Sophie Germain, Kummer, generations of attack. In 1995, Andrew Wiles — after seven years of secret labour — proved the modularity of semistable elliptic curves, from which Fermat's Last Theorem cascaded as a corollary.

❦ ❦ ❦
Chapter XThe Modern Cathedral

§10. Number theory now

Cryptography & Beyond


RSA & Public Key

1977 — Rivest, Shamir, Adleman. The hardness of factoring large semi-primes secures the world's banking, commerce, secrets. Number theory keeps your messages.

Elliptic Curves

Cubic curves y² = x³ + ax + b over finite fields. The arithmetic of their rational points fueled Wiles's proof and now powers ECC, used in TLS and blockchains.

The Langlands Program

Robert Langlands, 1967 — a vast web of conjectures linking number theory, representation theory, and harmonic analysis. A “grand unified theory” of mathematics, still being charted.

Galois representations automorphic forms.

The queen now wears digital robes.

Chapter XIOpen Problems

§11. Mysteries that abide

What We Do Not Know


All non-trivial zeros of ζ(s) = Σ 1/ns have real part ½. — A million-dollar Clay Prize. Equivalent to the deepest statements about the distribution of primes.
There are infinitely many primes p such that p + 2 is also prime. Zhang (2013): infinitely many prime gaps less than 70 million. Polymath then drove the bound below 250.
Every even integer n > 2 is the sum of two primes. Verified for n < 4 × 1018; proven for none.

The simplest questions hide the deepest secrets. Such has always been her way.

ColophonReferences

Further Reading


❦ ❦ ❦

Books

  • G. H. Hardy & E. M. Wright, An Introduction to the Theory of Numbers (1938).
  • C. F. Gauss, Disquisitiones Arithmeticae (1801).
  • K. Ireland & M. Rosen, A Classical Introduction to Modern Number Theory.
  • S. Singh, Fermat's Enigma (1997).
  • J. Derbyshire, Prime Obsession.
  • Euclid, Elements, Books VII–IX.

Video Lectures

A Final Word

“God may not play dice with the universe, but something strange is going on with the prime numbers.” — Paul Erdős


— Finis —