Skip to content
— CH. 1 · THE QUEEN OF MATHEMATICS —

Number theory

~7 min read · Ch. 1 of 7
7 sections
  • Carl Friedrich Gauss, who lived from 1777 to 1855, once delivered a verdict that still echoes through the field. "Mathematics is the queen of the sciences," he said, "and number theory is the queen of mathematics." Number theory is a branch of mathematics devoted mainly to the study of integers and arithmetic functions. The integers are the whole numbers, the natural numbers stretched to include zero and the negatives of the counting numbers.

    Here is the quirk that makes the subject so strange. Number theory deals with statements that are simple to understand yet extraordinarily difficult to solve. Fermat's Last Theorem took 358 years to prove after its original formulation. Goldbach's conjecture has remained unsolved since the 18th century, still resisting every attempt.

    For most of its life, this was the purest of pure mathematics, a discipline that seemed to touch nothing outside itself. Then the 1970s arrived. Prime numbers became the foundation for public-key cryptography algorithms, such as the RSA cryptosystem. How did a subject prized for its uselessness become the lock on the modern world? And why have its simplest questions outlasted the lives of everyone who asked them?

  • The earliest historical find of an arithmetical nature is Plimpton 322, dated to around 1800 BC. It is a broken clay tablet carrying a list of Pythagorean triples, integers that fit together in a particular way. The triples are too numerous and too large to have been obtained by brute force. One reading sees the table as a source of numerical examples for school problems. It remains the only surviving trace of what we would now call number theory inside Babylonian mathematics.

    Greek arithmetike took a different path, treating the study of numbers as a theoretical and philosophical pursuit. Euclid devoted part of his Elements to prime numbers and divisibility, giving the algorithm for the greatest common divisor and a proof implying that primes are infinite. Diophantus of Alexandria, who probably lived in the 3rd century AD, wrote the Arithmetica, a collection of worked problems hunting for rational solutions to polynomial equations.

    After the fall of Rome, the work shifted to Asia, though intermittently. The Chinese remainder theorem appears as an exercise in the Sunzi Suanjing, written between the third and fifth centuries, and was generalized in Qin Jiushao's 1247 treatise. Aryabhata, who lived from 476 to 550 AD, solved pairs of simultaneous congruences with a method he called kuttaka, the pulveriser. Brahmagupta, in 628 AD, began the systematic study of the Pell equation.

    Pierre de Fermat, the French mathematician who lived from 1607 to 1665, never published his writings. He communicated through correspondence and scribbled in marginal notes. From those scraps came Fermat's little theorem and Fermat's Last Theorem, conjectures that would occupy the field for centuries to come.

  • In 1729, an amateur named Christian Goldbach pointed his friend Leonhard Euler toward some of Fermat's work. Euler lived from 1707 to 1783, and that nudge has been called the rebirth of modern number theory. Fermat had struggled to win his contemporaries' attention. Euler proved Fermat's assertions, including Fermat's little theorem, and took the first steps toward analytic number theory.

    Three European contemporaries carried the elementary work forward. Joseph-Louis Lagrange, who lived from 1736 to 1813, gave full proofs of the four-square theorem and Wilson's theorem. Adrien-Marie Legendre, from 1752 to 1833, stated the law of quadratic reciprocity and, in his old age, became the first to prove a case of Fermat's Last Theorem.

    Gauss published Disquisitiones Arithmeticae in 1801, a work of immense influence that set the agenda for much of the 19th century. In it he proved the law of quadratic reciprocity and developed the theory of quadratic forms. He linked roots of unity to number theory, making forays toward the work of Evariste Galois and toward algebraic number theory itself. The subject was about to splinter into the modern subfields that define it today.

  • A prime number is an integer greater than one whose only positive divisors are one and the prime itself. An integer greater than one that is not prime is called composite. Euclid's theorem demonstrates that there are infinitely many primes, and the sieve of Eratosthenes was devised to identify all primes up to a given number by eliminating the composites.

    Factorization expresses a number as a product, and prime factorization repeats the process until every factor is prime. The fundamental theorem of arithmetic states that every integer greater than one factors into primes, and that this factorization is unique up to the order of the factors. Euclid's lemma underpins it: if a prime divides a product of integers, it divides at least one of the factors.

    Modular arithmetic works with finite sets of integers and introduces congruence and residue classes. The analogy is the 12-hour clock, where numbers wrap around rather than running off forever. Fermat's little theorem governs this world, and Euler's theorem extends it using Euler's totient function, which counts the positive integers up to a value that share no common factor with it. The Chinese remainder theorem solves congruences with unknowns, much as algebra solves equations.

  • The prime number theorem formalises a strange intuition: prime numbers appear less commonly as their value increases. This belongs to analytic number theory, which relies on complex numbers and techniques from analysis and calculus rather than elementary methods. It studies the distribution of primes, the behavior of number-theoretic functions, and irrational numbers.

    The zeta function sits at the heart of this work, connected to the very distribution of primes. Euler revealed a link expressing it as an infinite product over all prime numbers. Bernhard Riemann, in 1859, extended the definition to a complex variable and conjectured that all nontrivial zeros of the function lie where the real part equals one half. This is the Riemann hypothesis, still unsolved, and a solution would carry direct consequences for understanding how primes are spread.

    The line between elementary and analytic proof is not always sharp. The prime number theorem was first proven using complex analysis in 1896. An elementary proof was found only in 1949, by Erdos and Selberg. Even then, an elementary proof can run longer and harder than the advanced one it replaces. The toolbox of this field is unusually broad: the circle method, sieve methods, L-functions, and the theory of modular forms.

  • An equation in two variables defines a curve in the plane. That simple shift of perspective powers Diophantine geometry, which asks when a Diophantine equation has integer or rational solutions, and how many. The Pythagorean equation, for instance, corresponds to points with rational coordinates on a circle of radius one centered at the origin.

    Whether a curve carries finitely or infinitely many rational points depends crucially on a property called its genus. Wiles's proof of Fermat's Last Theorem stands as a major achievement of this geometric approach, drawing on other geometrical notions just as essential. Arithmetic geometry is the contemporary term for the same domain, used when the connections to modern algebraic geometry, as in Faltings' theorem, deserve emphasis.

    A closely linked area asks how well a given number can be approximated by rational numbers. If a number can be approximated better than any algebraic number, it is transcendental. It is by exactly this argument that pi and e have been shown to be transcendental. Algebraic number theory runs alongside, studying algebraic number fields. The Langlands program, one of the main large-scale research plans in mathematics today, is sometimes described as an attempt to generalise class field theory to non-abelian extensions of number fields.

  • Leonard Dickson, who lived from 1874 to 1954, once gave thanks for the very uselessness of his craft. "Thank God that number theory is unsullied by any application," he said. The British mathematician G. H. Hardy prided himself on work that had absolutely no military significance. For a long time the study of primes was the canonical example of pure mathematics, its only practical use being prime-numbered gear teeth to distribute wear evenly.

    That vision shattered in the 1970s, when it was publicly announced that prime numbers could anchor public-key cryptography. Schemes such as RSA rest on the difficulty of factoring large composite numbers into their prime factors. This created two haunting questions: can a number be factored, and can it be factored rapidly? Fast algorithms for testing primality are now known. Yet despite much theoretical and practical work, no truly fast algorithm for factoring has been found.

    The applications kept multiplying. The fast Fourier transform reaches into signal processing and data analysis. Finite fields and algebraic geometry build efficient error-correcting codes. In 1974, Donald Knuth observed that virtually every theorem in elementary number theory arises naturally in connection with making computers do high-speed numerical calculations. Even music carries the imprint, since equal temperament divides the octave into 12 equal parts using the properties of the 12th root of 2.

Common questions

What is number theory in mathematics?

Number theory is a branch of mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers, rational numbers, and generalizations of the integers such as algebraic integers. It is one of the oldest branches of mathematics alongside geometry.

Who called number theory the queen of mathematics?

Carl Friedrich Gauss, the German mathematician who lived from 1777 to 1855, called number theory the queen of mathematics. He said, "Mathematics is the queen of the sciences and number theory is the queen of mathematics." Gauss wrote Disquisitiones Arithmeticae in 1801, which set the agenda for much of 19th-century number theory.

What are the main branches of number theory?

The main subdivisions of number theory are elementary number theory, analytic number theory, and algebraic number theory. Elementary number theory uses basic arithmetic methods, analytic number theory relies on complex analysis and calculus, and algebraic number theory studies algebraic number fields. Further branches include probabilistic, combinatorial, computational, and applied number theory, along with Diophantine geometry.

How is number theory used in cryptography?

Number theory underpins public-key cryptography algorithms such as the RSA cryptosystem, which became prominent in the 1970s. RSA relies on the difficulty of factoring large composite numbers into their prime factors. Fast algorithms for testing primality are known, but no truly fast algorithm for factoring has been found.

What is the Riemann hypothesis in number theory?

The Riemann hypothesis concerns the zeta function, which Bernhard Riemann extended to a complex variable in 1859. He conjectured that all nontrivial zeros of the function occur where the real part equals one half. The hypothesis remains unsolved, and a solution would carry direct consequences for understanding the distribution of primes.

Why is number theory considered difficult?

Number theory deals with statements that are simple to understand but very difficult to solve. Fermat's Last Theorem was proved 358 years after its original formulation, and Goldbach's conjecture has remained unsolved since the 18th century. Many results can be stated to a layperson, yet their proofs draw on an unusually broad range of mathematical tools.