Number theory
Number theory is the branch of mathematics that studies the integers (whole numbers such as 1, 2, and 3) and number systems built from them. It is sometimes called "higher arithmetic" and is one of the oldest parts of mathematics.[1]
Its central questions include:
- how integers divide one another;
- which integers are prime;
- which equations have whole-number solutions.
Many of its problems are easy for anyone to understand but very hard to solve.[1]
Until the mid-20th century, number theory was seen as the most theoretical area of mathematics, with no direct use in the real world.[1]
Digital computers and communications changed that. Number theory is now the basis for widely used encryption, which changes a message so that only someone with the right key can read it.[1][2]
Divisibility and primes
Divisors and prime numbers
One whole number divides another when the division leaves no remainder. The first number is then a divisor, or factor, of the second. For example, 3 divides 12 because 12 = 3 × 4.[1]
A prime number is a whole number greater than 1 that cannot be written as the product of two smaller whole numbers. The first primes are 2, 3, 5, 7, 11, and 13. A whole number greater than 1 that is not prime, such as 4, 6, or 9, is called composite.[3][1]
Infinitely many primes
Euclid proved in his Elements (about 300 BCE) that the primes never run out. This result is now called Euclid's theorem, and his proof works like this.[1]
- Take any finite list of primes .
- Multiply them and add 1 to get .
- If is prime, it is a new prime, since it is larger than every prime on the list.
- If is composite, it has a prime factor. That factor is not on the list, because dividing by any listed prime leaves remainder 1.
- Either way the list was incomplete, so no finite list holds all the primes.
For example, is itself a new prime. In contrast, is composite, but its prime factors 5 and 31 are new.[1]
Unique factorization
Every whole number greater than 1 is built by multiplying primes. The fundamental theorem of arithmetic says that this can be done in exactly one way, apart from the order of the factors.[1]
Euclid gave a version of this theorem, though not one that meets modern standards. Carl Friedrich Gauss gave the first modern proof in 1801.[1][4]
Greatest common divisor
The greatest common divisor (GCD) of two numbers is the largest number that divides both. Two numbers whose GCD is 1 share no factor except 1 and are called coprime.
The Euclidean algorithm, described in the Elements, finds the GCD by repeated division with remainder.[5][1]
- Divide the larger number by the smaller one and note the remainder.
- Divide the previous divisor by that remainder.
- Repeat until the remainder is 0. The last nonzero remainder is the GCD.
For 56 and 12, the steps are , then , then , so the GCD is 4.[5]
The method is fast. Computers still use it with minor changes.[5]
Modular arithmetic
Congruences
Modular arithmetic is arithmetic with remainders. Two integers are congruent modulo when divides their difference.[4]
Here and are integers, and , the modulus, is a positive integer. For example, because .[4] Counting modulo works like moving around a clock face with positions.
Gauss introduced this idea and notation in his 1801 book Disquisitiones Arithmeticae.[4]
Key theorems
- Fermat's little theorem: if is prime and is any integer, then . Pierre de Fermat stated it in 1640, and Leonhard Euler proved it in 1736. For and , it says that 7 divides .[4]
- Wilson's theorem: a whole number is prime exactly when divides , where is the product . Joseph-Louis Lagrange proved it soon after 1770.[4]
- Chinese remainder theorem: it solves several congruences at once. The Chinese mathematician Sun Zi asked for a number that leaves remainder 2 when divided by 3, remainder 3 when divided by 5, and remainder 2 when divided by 7 (his answer was 23).[1] His dates are uncertain, and historians' estimates range from the 3rd to the 5th century CE.[6] Qin Jiushao (1202 to 1261) later gave a general method for such problems.[1]
- Quadratic reciprocity: a law that Euler noticed. Gauss gave the first complete proof in 1796 and published it in 1801.[4][7] Class field theory, covered under algebraic number theory, generalizes it broadly.[8]
Diophantine equations
Whole-number solutions
A Diophantine equation is an equation whose solutions must be whole numbers.[1]
The name honors Diophantus of Alexandria (about 250 CE), whose book Arithmetica posed many such problems.[1]
Diophantus himself accepted positive fractions as answers and did not require whole numbers.[9]
The whole-number condition is what makes these problems hard. One of his problems asks for a square and a cube whose squares add up to a square, which as a whole-number problem reads .[1]
Real numbers are all the numbers on the number line, including fractions and numbers such as . Real solutions such as , , are easy, but finding a whole-number answer such as , , takes more work.[1]
Famous examples
| Equation | Name | What is known |
|---|---|---|
| Linear equation | The Euclidean algorithm is the basic tool for finding whole-number solutions.[5] | |
| Pythagorean triples | The Babylonian tablet Plimpton 322 (about 1700 BCE) lists solutions such as 2,291, 2,700, and 3,541.[1] | |
| A Pell equation | Brahmagupta (7th century) found , .[1] | |
| , with an odd prime | Sums of two squares | Solvable exactly when has the form , as in and . Fermat stated it and Euler proved it.[4] |
| Four squares | Every whole number is a sum of four or fewer squares. Lagrange proved it in 1770.[4] | |
| , with | Fermat's Last Theorem | No solutions in positive whole numbers. Andrew Wiles proved it in 1994, and the proof was published in 1995.[10] |
Fermat's margin note
While reading Diophantus's Arithmetica, Fermat wrote in the margin that no cube splits into two cubes, and no higher power splits into two powers of the same kind. He added that he had found "an admirable proof" but the margin was too narrow to hold it. For three and a half centuries, no one could prove the claim.[4]
Fermat did leave a proof of a related fact: no right triangle with whole-number sides has an area that is a perfect square. He used infinite descent, which shows that any solution would produce a smaller one, and so on forever. Since positive whole numbers cannot keep shrinking forever, no solution can exist.[4]
Distribution of primes
Counting primes
The prime-counting function gives the number of primes less than or equal to . The table shows that primes become rarer as numbers grow.[2][11]
| Share of numbers up to that are prime | |||
|---|---|---|---|
| 10 | 4 | 4.3 | 40% |
| 100 | 25 | 21.7 | 25% |
| 1,000 | 168 | 145 | 16.8% |
| 1,000,000 | 78,498 | 72,382 | about 7.8% |
The prime number theorem describes this thinning. It says that grows like , where is the natural logarithm of .[12]
The symbol means that the ratio of the two sides gets closer and closer to 1 as gets larger. Put another way, the average gap between primes near a large number is about .[12]
The young Gauss guessed this law by studying tables of primes and logarithms.[2] In an 1849 letter he wrote that he had found early on that is well approximated by the logarithmic integral below.[13]
The integrand, the function being integrated, is undefined at , where . So the integral is taken as a Cauchy principal value. This means cutting out equal small intervals on both sides of , integrating over the rest, and letting the intervals shrink to zero.
After major progress by Bernhard Riemann and Pafnuty Chebyshev, Jacques Hadamard and Charles Jean de la Vallée Poussin proved the prime number theorem in 1896.[2]
Primes in arithmetic progressions
Two classic results show that primes keep appearing in predictable places.
- Dirichlet's theorem on arithmetic progressions: if positive whole numbers and have no common factor, the sequence contains infinitely many primes. For example, there are infinitely many primes of the form and infinitely many of the form .[4]
- Chebyshev's theorem: for every there is a prime between and . At age 18, Paul Erdős published a much simpler proof of it.[2]
Peter Gustav Lejeune Dirichlet's proof used calculus, the branch of mathematics that studies rates of change and accumulation, to answer a question about whole numbers. This approach started analytic number theory.[4]
The Riemann zeta function
The Riemann zeta function links primes to analysis. It is defined for complex numbers whose real part (the real-number coordinate of ) is greater than 1. There it equals both a sum over all whole numbers and a product over all primes .[13]
The product form is called the Euler product. Three facts tie it to the primes.
- History: the Euler product first appeared in Euler's book Introductio in Analysin Infinitorum (1748).[13]
- Unique factorization: multiplying out the product gives each term exactly once, which reflects unique factorization.
- Riemann's link: in an 1859 paper, Riemann showed that how often primes occur is closely tied to the behavior of .[3][13]
The function extends to all other complex numbers, with two notable features.[13]
- It has a pole at , a point where the function grows without bound.
- It is zero at the negative even integers , which are called the trivial zeros.
The Riemann hypothesis
The Riemann hypothesis states that every other zero, called a nontrivial zero, has real part exactly .[13]
The hypothesis has been checked for the first 10 trillion nontrivial zeros. A proof would settle many questions about how the primes are spread out.[3]
Branches of number theory
Main areas
Modern number theory is divided into areas mainly by the methods they use, such as elementary, algebraic, analytic, geometric, and probabilistic number theory.[1] The Mathematics Subject Classification (MSC), used to index research papers, lists these areas and others under class 11.[14]
| Area | Typical topics | MSC class |
|---|---|---|
| Elementary | Divisibility, GCDs, congruences, primes, factorization | 11A |
| Multiplicative | Distribution of primes, primes in congruence classes, sieves (methods that count numbers left after removing multiples of small primes) | 11N |
| Additive | Waring's problem, Goldbach-type problems, partitions (ways to write a number as a sum) | 11P |
| Zeta and L-functions (part of analytic) | , Dirichlet L-functions, the Riemann hypothesis. L-functions are functions like attached to other objects in number theory. | 11M |
| Algebraic | Algebraic integers, number fields, class field theory | 11R, 11S |
| Arithmetic geometry | Elliptic curves, Diophantine geometry (geometric methods for solving equations in whole numbers) | 11G |
| Modular forms | Modular and automorphic forms, Galois representations | 11F |
| Diophantine approximation and transcendence | Approximation of numbers, continued fractions, irrationality (being impossible to write as a ratio of integers), transcendence | 11J |
| Geometry of numbers | Lattices (regular grids of points) and convex bodies | 11H |
| Probabilistic | Distribution modulo 1 (how the fractional parts of a sequence spread out), normal numbers | 11K |
| Computational | Factorization, primality testing, number-theoretic algorithms | 11Y |
Algebraic number theory
Algebraic number theory studies number systems larger than the integers.[15]
Gauss studied numbers of the form , where and are integers and , now called Gaussian integers. In 1832 he proved that they obey a version of unique factorization, with primes suitably defined.[15]
In the 1840s Ernst Kummer extended this work to other systems of complex numbers, but unique factorization turned out to fail in general. Among numbers of the form , the number 21 factors in two different ways.[15]
None of these four factors splits further in this system. Yet 3 divides 21 without dividing either or , which breaks a property of primes known since Euclid.[15]
Richard Dedekind resolved this problem in work spanning over 30 years, starting in 1871. His key idea was to replace single numbers by ideals, sets of algebraic integers that behave like the set of all multiples of a given number.[15]
Ideals let Dedekind extend prime factorization to general fields of complex numbers, now called number fields.[15]
Zeta functions and L-functions
The Riemann zeta function is the model for a broad class of functions called L-functions. Each is attached to an algebraic or arithmetic object, and the most important properties of that object are expected to show up in the locations of its zeros and poles and in its values at special points.[13]
Each L-function is expected to satisfy its own Riemann hypothesis, the generalized Riemann hypothesis. The official Clay description of the problem states that not a single case of this has been proved or disproved for these L-functions.[13]
Modern breakthroughs
Proof of Fermat's Last Theorem
The proof of Fermat's Last Theorem went through elliptic curves, a kind of curve defined by a cubic equation. Gerhard Frey suggested, and Ken Ribet proved, building on ideas of Barry Mazur and Jean-Pierre Serre, that the theorem follows from the Shimura-Taniyama conjecture, which was then a claim not yet proved.[10]
The conjecture says that every elliptic curve over the rational numbers (fractions of integers with nonzero denominators) is modular. This means the curve can be described using modular functions, functions with a special kind of symmetry.[10][13]
The argument runs as follows.[10]
- Suppose had a solution in positive whole numbers with .
- Then the elliptic curve could not be modular (Ribet).
- Wiles proved that all semistable elliptic curves over the rational numbers are modular, which covers this curve. Being semistable is a technical condition on how the curve behaves when its equation is reduced modulo each prime.
- The curve would have to be both modular and not modular, so no such solution exists.
Andrew Wiles spent seven years focusing on the problem. He announced a proof in 1993, but a hard-to-spot error was found while it was being written up. Helped by Richard Taylor, with whom he did one key step, he found the fix on 19 September 1994, and the proof appeared in the Annals of Mathematics in 1995.[10]
Wiles received the 2016 Abel Prize "for his stunning proof of Fermat's Last Theorem by way of the modularity conjecture for semistable elliptic curves, opening a new era in number theory."[16]
In 2001 Christophe Breuil, Brian Conrad, Fred Diamond, and Richard Taylor proved the conjecture for all elliptic curves over the rational numbers. It is now called the modularity theorem.[10]
The Langlands program
The Langlands program predicts "a tight web of connections between automorphic forms and Galois groups." Robert Langlands outlined it in a 1967 letter to André Weil.[8]
- Recognition: Langlands received the 2018 Abel Prize "for his visionary program connecting representation theory to number theory."[8]
- Role in Wiles's proof: Langlands's work on base change for GL(2), the group of invertible 2 × 2 matrices, played a role in Wiles's proof. Base change moves automorphic forms from one number field to a larger one.[8]
- Unifying role: the program also ties together results such as the modularity of elliptic curves.[8]
Representation theory, named in the prize citation, studies symmetry by turning group elements into matrices.
Bounded gaps between primes
In 2013 Yitang Zhang proved bounded gaps between primes: infinitely many pairs of primes differ by less than 70 million. Before this, no one knew that any fixed gap between primes occurs infinitely often.[12] His paper appeared in the Annals of Mathematics in 2014.[17]
Applications
Public-key cryptography
Number theory became practical through public-key cryptography. In such a system, anyone can encrypt a message with a published key, but only the holder of a secret key can decrypt it.[18]
The RSA cryptosystem, published by Ronald Rivest, Adi Shamir, and Leonard Adleman in 1978, works like this.[18]
- The receiver picks two large secret primes and . They publish the product and a power .
- The sender writes the message as a number with and sends , the remainder when is divided by .
- The receiver recovers the message as , using a secret power chosen so that .
The security of RSA rests in part on how hard it is to factor , since anyone who finds and can compute .[18]
In 1978 the authors recommended that be about 200 digits long.[18]
Computation
Computers have also changed number theory itself. They let number theorists:[1]
- factor large numbers;
- find primes;
- test conjectures;
- solve numerical problems once out of reach.
The MSC gives computational number theory its own class (11Y). It also groups algebraic coding theory with cryptography as number-theoretic applications (11T71).[14]
Open problems
Many simple-sounding questions remain open.[2]
- Goldbach's conjecture: every even number greater than 2 is the sum of two primes. This was Christian Goldbach's claim, and Euler agreed with it but could not prove it.[4]
- Twin prime conjecture: there are infinitely many twin primes, pairs of primes that differ by 2, such as 5 and 7 or 41 and 43.[2] Zhang's theorem is a large step toward it.[12]
- Riemann hypothesis: it is one of the seven Millennium Prize Problems named by the Clay Mathematics Institute in 2000, each with a one-million-dollar prize for a correct solution.[2][3]
History
Ancient and medieval
The Pythagoreans attached meaning to perfect numbers, which equal the sum of their proper divisors (the divisors smaller than the number itself). Examples are 6 = 1 + 2 + 3 and 28.[1]
Euclid's theorems on primes, divisors, and perfect numbers then marked the start of number theory as mathematics rather than number mysticism.[1]
In the following centuries, scholars in China, India, and Baghdad made their own advances.
- Sun Zi, in China, did work driven by astronomy and the calendar.[1]
- Brahmagupta, in India, studied the Pell equation in the 7th century.[1]
- Thabit ibn Qurrah, in 9th-century Baghdad, found the pair of amicable numbers 17,296 and 18,416, where each is the sum of the proper divisors of the other.[1] The historian J. P. Hogendijk showed that Thabit was probably the first to find this pair.[19]
Early modern Europe
From 1400 to 1650, number theory was seen in Europe as a minor subject, mostly of interest as puzzles.[1]
Fermat then made many bold claims, usually without proof. Euler brought the field into the mainstream with over a thousand pages of research.[4]
Gauss and after
Gauss's Disquisitiones Arithmeticae (1801) organized the earlier work and became a foundation of the subject. Gauss called number theory "the queen of mathematics."[4][2]
The 20th century brought figures such as Srinivasa Ramanujan (1887 to 1920) and Paul Erdős (1913 to 1996). Erdős published over 1,500 papers with more than 500 collaborators.[2]
Timeline
| Date | Event |
|---|---|
| About 1700 BCE | Plimpton 322 lists Pythagorean triples[1] |
| About 300 BCE | Euclid's Elements proves there are infinitely many primes and gives the Euclidean algorithm[1] |
| About 250 CE | Diophantus writes Arithmetica[1] |
| 3rd to 5th century CE (uncertain) | Sun Zi poses remainder problems[1][6] |
| 7th century | Brahmagupta studies the Pell equation[1] |
| 9th century | Thabit ibn Qurrah, probably first, finds the amicable pair 17,296 and 18,416[1][19] |
| 13th century | Qin Jiushao gives a general method for remainder problems[1] |
| 1640 | Fermat states his little theorem[4] |
| 1770 | Lagrange proves the four-square theorem[4] |
| 1801 | Gauss publishes Disquisitiones Arithmeticae[4] |
| 1847 or 1850 (sources differ) | Kummer proves Fermat's Last Theorem for a large class of exponents[4][20] |
| 1859 | Riemann links the primes to the zeta function[13] |
| 1896 | Hadamard and de la Vallée Poussin prove the prime number theorem[2] |
| 1978 | The RSA cryptosystem is published[18] |
| 1995 | Wiles's proof of Fermat's Last Theorem is published[10] |
| 2013 | Zhang proves bounded gaps between primes[12] |
References
- Number theory, Encyclopaedia Britannica (William Dunham), 2026.
- Number theory: Prime number theorem, 20th century, and unsolved problems, Encyclopaedia Britannica (William Dunham), 2026.
- Riemann Hypothesis, Clay Mathematics Institute, 2026.
- Number theory: Modern number theory, Encyclopaedia Britannica (William Dunham), 2026.
- Euclidean algorithm, Encyclopaedia Britannica, 2026.
- Sun Zi: biography, MacTutor History of Mathematics, University of St Andrews, 2003.
- The mathematics of Gauss, Cornell University Department of Mathematics, 2004.
- The Abel Prize 2018: Robert P. Langlands, citation, Norwegian Academy of Science and Letters, 2018.
- Diophantus: biography, MacTutor History of Mathematics, University of St Andrews, 1999.
- Andrew John Wiles: biography, MacTutor History of Mathematics, University of St Andrews, 2023.
- How many primes are there?, PrimePages, 2026.
- Zhang's Theorem on Bounded Gaps Between Primes, Dan Goldston, American Institute of Mathematics, 2013.
- The Riemann Hypothesis: official problem description, Clay Mathematics Institute, 2000.
- MSC2020 class 11: Number theory, zbMATH Open, FIZ Karlsruhe, 2020.
- Algebra: Fundamental concepts of modern algebra, Encyclopaedia Britannica, 2026.
- 2016: Sir Andrew J. Wiles, The Abel Prize, Norwegian Academy of Science and Letters, 2016.
- Bounded gaps between primes, Yitang Zhang, Annals of Mathematics 179(3), 2014.
- A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, R. L. Rivest, A. Shamir, and L. Adleman, Communications of the ACM, 1978.
- Thabit: biography, MacTutor History of Mathematics, University of St Andrews, 1999.
- Hunting Prime Numbers: from Human to Electronic Computers, The Rutherford Journal, 2010.
