Number Theory
Number Theory is the study of the integers and their arithmetic structure — divisibility, primes, congruences, and Diophantine equations. Key result in words: every integer greater than 1 factors uniquely into primes, and the distribution and behavior of those primes underlie nearly all of arithmetic. Where it applies: cryptography, coding theory, computer algebra, and pure mathematics. Who/when: from Euclid (~300 BCE) and Diophantus through Fermat, Euler, Gauss (Disquisitiones Arithmeticae, 1801), to modern analytic and algebraic number theory.
The integers are not a featureless set: they carry a rigid multiplicative skeleton built from the primes, the indivisible atoms of arithmetic. Two engines drive the whole subject. First, unique factorization (the Fundamental Theorem of Arithmetic) lets us reduce questions about all integers to questions about primes. Second, congruence (working modulo ) partitions the infinite integers into a finite arithmetic system , where addition, multiplication, and even "square roots" can be analyzed exhaustively. Almost every classical theorem — Fermat's little theorem, Euler's theorem, the Chinese Remainder Theorem, quadratic reciprocity — is a statement about the structure of these finite systems and how the primes thread through them.
Formal Statement
For integers with , we say divides (written ) if there exists an integer with . A prime is an integer whose only positive divisors are and . An integer that is not prime is composite. The greatest common divisor is the largest positive integer dividing both and ; if , and are coprime.
Every integer can be written as a product of primes, and this factorization is unique up to the order of the factors:
Derivation hint: existence by strong induction (split any composite into smaller factors); uniqueness from Euclid's Lemma — if then or .
For a positive integer (the modulus), integers and are congruent modulo , written , if . This is an equivalence relation partitioning into residue classes, forming the ring .
Derivation hint: directly from the definition of divisibility applied to the difference .
For integers not both zero, there exist integers such that
Derivation hint: is the smallest positive value of ; run the Extended Euclidean Algorithm to produce explicit .
If is prime and , then . More generally, if ,
where is Euler's totient — the count of integers in coprime to . Derivation hint: the units mod form a group of order ; apply Lagrange's theorem (order of an element divides group order).
For distinct odd primes , with the Legendre symbol recording whether is a nonzero square mod ,
Derivation hint: Gauss's lemma counts sign changes of multiples of in a half-residue system; Eisenstein's lattice-point argument geometrizes the exponent.
Letting count primes ,
Derivation hint: relate to the Riemann zeta function via the Euler product; the key analytic input is that has no zeros on the line .
Why It Holds / Derivation
We prove uniqueness, given existence. 1. Euclid's Lemma. Suppose is prime and . If , then (since 's only divisors are ). By Bézout (eq. [3]) there are integers with . 2. Multiply by : . Since and (so ), divides the left side, hence . 3. Extending to products. By induction, if , then for some . 4. Uniqueness. Suppose are two prime factorizations. Then , so by step 3 for some (both prime). Cancel them. 5. Repeat. Each matches a unique and vice versa, so and the multisets of primes coincide.
∎1. Let be the set of residue classes coprime to . It is a group under multiplication mod with . 2. Closure holds because ; inverses exist by Bézout (eq. [3]). 3. By Lagrange's Theorem, the order of any element divides . 4. Hence . Taking gives , recovering Fermat's Little Theorem.
∎Gauss called number theory "the Queen of Mathematics." At age 24 he published Disquisitiones Arithmeticae (1801), which systematized congruences, introduced the now-standard notation, and gave the first complete proof of quadratic reciprocity — a theorem he proved in at least eight distinct ways over his life, calling it the theorema aureum (golden theorem). He also conjectured the Prime Number Theorem as a teenager by examining prime-counting tables, anticipating the logarithmic integral as a far better approximation to than . His work on Gaussian integers launched algebraic number theory.
Building Intuition
Think of the primes as a basis for the integers under multiplication — not a vector-space basis, but an analogous "independent generating set." Every integer is a unique "word" spelled in prime letters (eq. [1]). Divisibility becomes a coordinate-wise comparison: iff every prime appears in to a lower-or-equal power than in . This is why and are just the coordinate-wise min and max of exponents. Congruence is the act of folding the number line into a circle of circumference . Once folded, only finitely many points remain, so any question — "is there a solution?", "what are all the squares?" — becomes a finite check. The miracle of number theory is that statements about the infinite integers (eq. [4], [5]) reduce to finite combinatorics in these clocks, while the distribution of primes (eq. [6]) reaches back out to the infinite via complex analysis.
Worked Examples
Given: Solve .
Step 1 — Find and Bézout coefficients.
- , so (the congruence is solvable).
Step 2 — Back-substitute for . . So , giving .
Step 3 — Multiply both sides by the inverse. . Since :
Check: . ✓
Given: Find with , , .
Step 1 — Modulus product. . Partial products: .
Step 2 — Inverses.
- , need : .
- , so .
- , so .
Step 3 — Combine. . :
Check: ✓, ✓, ✓.
Common Misconceptions
"Every ring of integers has unique factorization." False. In ,
two genuinely different factorizations into irreducibles. The Fundamental Theorem of Arithmetic is a special property of (and of certain rings called UFDs). Recovering unique factorization in general required Dedekind's theory of ideals — and that historical failure is precisely why algebraic number theory exists.
"Fermat's Little Theorem characterizes primes." Not quite. There are Carmichael numbers (e.g., ) that are composite yet satisfy for all coprime to , fooling naive primality tests.
Claim: "If is prime then is prime (Mersenne primes)." Refutation: is prime, but is composite. Primality of the exponent is necessary (if is composite, is composite) but not sufficient. Whether infinitely many Mersenne primes exist remains open.
Connections
Number theory sits at a crossroads. Modular arithmetic is the entry point to Abstract Algebra: is the canonical example of a ring, and a finite abelian group, so Group Theory (Lagrange's theorem) directly yields Euler's theorem (eq. [4]). The leap to analytic number theory ties the integers to Complex Analysis through the Riemann zeta function and the Euler product, which is how the Prime Number Theorem (eq. [6]) is proved. The failure of unique factorization links to Ring Theory and Dedekind domains, while Galois Theory explains quadratic reciprocity (eq. [5]) as a shadow of class field theory. Finally, the geometry of solutions to Diophantine equations connects to Elliptic Curves and Algebraic Geometry.
Real-World Applications
Historical Development
Subtleties & Limits
Number theory is famous for elementary-sounding questions that resist all attack.
- Riemann Hypothesis: all nontrivial zeros of have . It would sharpen the error term in the Prime Number Theorem (eq. [6]) to . (Clay Millennium Prize.)
- Goldbach's Conjecture: every even integer is a sum of two primes. Verified past , unproven.
- Twin Prime Conjecture: infinitely many primes with prime. Zhang (2013) proved bounded gaps exist; the gap is now (Polymath/Maynard), not yet .
- abc Conjecture: a deep inequality relating prime factors of ; would imply many results including (asymptotic) FLT. Mochizuki's claimed proof remains disputed.
- Infinitude of Mersenne primes and existence of odd perfect numbers — both open since antiquity.
See Also
Abstract Algebra · Group Theory · Ring Theory · Complex Analysis · Galois Theory · Cryptography · Finite Fields · Elliptic Curves · Algebraic Number Theory · Analytic Number Theory