Definition
Number theory is the area of mathematics devoted to studying the integers — the counting numbers, their negatives, and zero — and the structures that arise from them. Despite the apparent simplicity of its subject matter, number theory produces some of mathematics' most striking results and some of its most resistant open problems. Questions that can be stated in a single sentence — are there infinitely many prime pairs differing by 2? can every even number greater than 2 be written as the sum of two primes? — have resisted proof for centuries and in some cases millennia.
The central objects of number theory are the prime numbers: integers greater than 1 that are divisible only by 1 and themselves. Primes are the building blocks of all integers, in the sense captured by the Fundamental Theorem of Arithmetic: every integer greater than 1 can be written as a product of primes in exactly one way (up to ordering). This uniqueness of factorisation is far from obvious and is genuinely powerful — it means that primes act as a kind of atomic vocabulary for all of arithmetic, and understanding their distribution is central to understanding integers in general.
Number theory divides into several connected sub-disciplines. Elementary number theory studies divisibility, modular arithmetic, and prime factorisation using methods accessible without calculus. Analytic number theory uses tools from analysis — infinite series, complex functions, integration — to study the distribution of primes. Algebraic number theory extends the integers to larger number systems (rings of algebraic integers) to understand factorisation more deeply. And computational number theory develops efficient algorithms for number-theoretic problems, many of which have direct applications in cryptography.
Why it matters
How it works
Divisibility, primes, and modular arithmetic
The core of elementary number theory rests on divisibility: integer a divides integer b if there is an integer k such that b = ak. From this simple definition, a rich structure unfolds: the greatest common divisor, least common multiple, the Euclidean algorithm (one of the oldest algorithms in mathematics, computing GCDs efficiently), and Bézout's identity. These tools make it possible to study whether equations have integer solutions and how many.
Modular arithmetic — sometimes described as 'clock arithmetic' — works with remainders after division. Two integers are congruent modulo n if they have the same remainder when divided by n. Modular arithmetic has elegant algebraic properties: addition and multiplication both work consistently with congruence, making modular arithmetic a well-behaved algebraic structure (a ring). The theorems of Fermat and Euler characterise the behaviour of numbers raised to large powers modulo a prime or composite, and these results are directly exploited in modern cryptographic protocols that rely on the difficulty of reversing certain modular operations.
Distribution of primes
One of the deepest questions in number theory is how primes are distributed among the integers. They become increasingly sparse as numbers grow larger — there are 25 primes below 100, but only 21 between 1 000 and 1 100 — yet they never stop. Euclid's proof that primes are infinite is one of mathematics' oldest and most elegant arguments. The Prime Number Theorem gives a quantitative description: the number of primes below x is approximately x / ln(x), a result that required the full machinery of complex analysis to prove. The Riemann Hypothesis, if true, would give a much more precise account of the deviations from this approximation, with far-reaching consequences throughout mathematics.
Where it goes next
Number theory reaches into logic and foundations through Gödel's incompleteness theorems, which were partly motivated by questions about provability in arithmetic. It connects to algebra through algebraic number theory and to analysis through the study of the Riemann zeta function. In computer science, the interface with algorithms and computational complexity is immediate — many of the fastest known algorithms are number-theoretic, and questions about which number-theoretic problems are computationally hard are among the central open questions in complexity theory. Exploring formal systems provides the logical-foundations perspective; algorithms and diagonalization connect to the computational side of the field.