Number theory
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.
Updated
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.
All sources
122 references cited across the entry
- 1Number theoryA.A. Karatsuba — Springer — 2020
- 2BookThe Gale Encyclopedia of SciencePatrick Moore — Gale — 2004
- 6Serre (1996)Serre — 1996
- 7BookElementary Number TheoryGove Effinger et al. — CRC Press — 2022
- 8BookCRC Concise Encyclopedia of MathematicsEric W. Weisstein — Chapman & Hall/CRC — 2003
- 10Neugebauer, Sachs (1945) p. 40Neugebauer, Sachs — 1945
- 11Robson (2001) p. 189Robson — 2001
- 12Neugebauer (1969) p. 36–40Neugebauer — 1969
- 13Robson (2001) p. 201Robson — 2001
- 14Guthrie (1987)Guthrie — 1987
- 15Huffman (2011)Huffman — 2011
- 16BookA Brief History of NumbersLeo Corry — Oxford University Press — 2015
- 17Lam, Ang (2004) p. 219–220Lam, Ang — 2004
- 18Lam, Ang (2004) p. 27–28Lam, Ang — 2004
- 19Lam, Ang (2004) p. 223–224Lam, Ang — 2004
- 20Plofker (2008) p. 42Plofker — 2008
- 21Plofker (2008) p. 134–140Plofker — 2008
- 22Colebrooke (1817) p. lxvColebrooke — 1817
- 23Pingree (1968) p. 97–125Pingree — 1968
- 24Bachet, 1621, following a first attempt by Xylander, 1575
- 26Numbers and MeasurementsNicholas Faulkner et al. — 2017
- 27Weil (1984) p. 159, 161Weil — 1984
- 28Weil (1984) p. 174Weil — 1984
- 29Varadarajan (2006) p. 45–55Varadarajan — 2006
- 30Goldstein, Schappacher (2007) p. 16Goldstein, Schappacher — 2007
- 31Goldstein, Schappacher (2007)Goldstein, Schappacher — 2007
- 32Davenport, Montgomery (2000) p. section 1Davenport, Montgomery — 2000
- 33Iwaniec, Kowalski (2004) p. 1Iwaniec, Kowalski — 2004
- 34BookEncyclopedia of MathematicsJames Tanton — Facts On File — 2005
- 35BookElementary Methods in Number TheoryMelvyn B. Nathanson — Springer — 2000
- 36Elementary number theoryA.A. Bukhshtab — Springer — 2014
- 38Richmond & Richmond (2009), Section 3.4 (Divisibility Tests), p. 102–108
- 39BookNumber Theory and Its HistoryOystein Ore — McGraw-Hill — 1948
- 40BookNumber Theory: A Historical ApproachJohn J. Watkins — Princeton University Press — 2014
- 41BookElementary Methods in Number TheoryMelvyn B. Nathanson — 2000
- 42BookA Computational Introduction to Number Theory and AlgebraVictor Shoup — Cambridge University Press — 2005
- 43Granville (2008) p. section 1Granville — 2008
- 44Analytic number theoryA.A. Karatsuba — 2014-10-18
- 45BookEncyclopedia of MathematicsJames Tanton
- 46BookCRC Concise Encyclopedia of MathematicsEric W. Weisstein — 2002
- 47BookEncyclopedia of MathematicsJames Tanton — 2005
- 48Granville (2008) p. section 3Granville — 2008
- 49Montgomery, Vaughan (2007)Montgomery, Vaughan — 2007
- 50Iwaniec, Kowalski (2004)Iwaniec, Kowalski — 2004
- 51This is the case for some combinatorial sieves such as the Brun sieve, rather than for large sieves. The study of the latter now includes ideas from harmonic and functional analysis.
- 52The Galois group of an extension L/K consists of the operations (isomorphisms) that send elements of L to other elements of L while leaving all elements of K fixed. Thus, for instance, Gal(C/R) consis
- 53The genus can be defined as follows: allow the variables in to be complex numbers; then defines a 2-dimensional surface in (projective) 4-dimensional space (since two complex variables can be decompos
- 54BookHow Round is Your Circle?: Where Engineering and Mathematics MeetJohn Bryant et al. — Princeton University Press — 2008
- 55BookA Mathematician's ApologyGodfrey Harold Hardy — Cambridge University Press — 2012
- 56The Unreasonable Effectiveness of Number Theory, Stefan Andrus Burr, George E. Andrews, American Mathematical Soc., 1992,
- 57BookElementary Number TheoryJames S. Kraft et al. — CRC Press — 2014
- 58BookAn Introduction to Number Theory with CryptographyJames Kraft et al. — 2018
- 59Computer science and its relation to mathematics" DE Knuth – The American Mathematical Monthly, 1974
- 60"Applications of number theory to numerical analysis", Lo-keng Hua, Luogeng Hua, Yuan Wang, Springer-Verlag, 1981,
- 61BookDigital Signal Processing AlgorithmsHari Krishna — Routledge — 2017
- 62JournalPhysics of the Riemann HypothesisDaniel Schumayer et al. — 2011
- 63BookError-Correcting CodesJohn Baylis — 2018
- 64JournalAesthetics, Dynamics, and Musical Scales: A Golden ConnectionJulyan H. E. Cartwright et al. — March 2002
- 65The Mathematics of Egypt, Mesopotamia, China, India and Islam : A SourcebookJoseph W. Dauben — Princeton University Press — 2007
- 66BookIntroduction to analytic number theoryTom M. Apostol — Springer — 1976
- 67Chinese Mathematics in the Thirteenth Century: the "Shu-shu Chiu-chang" of Ch'in Chiu-shaoUlrich Libbrecht — Dover Publications Inc — 1973
- 68JournalAn Introduction to the Theory of Numbers (Review of Hardy & Wright.)Tom M. Apostol — American Mathematical Society — 1981
- 69JournalDie Lehre von Geraden und Ungeraden im neunten Buch der euklidischen ElementeOskar Becker — 1936
- 70BookA History of MathematicsCarl Benjamin Boyer et al. — Wiley — 1991
- 71BookThe Āryabhaṭīya of Āryabhaṭa: An ancient Indian work on Mathematics and AstronomyAryabhata — University of Chicago Press — 1930
- 72BookAlgebra, with Arithmetic and Mensuration, from the Sanscrit of Brahmegupta and BháscaraHenry Thomas Colebrooke — J. Murray — 1817
- 73BookMultiplicative Number TheoryHarold Davenport et al. — Springer — 2000
- 74JournalEuler and Quadratic ReciprocityHarold M. Edwards — November 1983
- 75BookFermat's Last Theorem: a Genetic Introduction to Algebraic Number TheoryHarold M. Edwards — Springer Verlag — 2000
- 76BookVaria Opera MathematicaPierre de Fermat — Joannis Pech — 1679
- 77JournalMethods and Traditions of Babylonian Mathematics: Plimpton 322, Pythagorean Triples and the Babylonian Triangle Parameter EquationsJöran Friberg — August 1981
- 78BookClassics in the History of Greek MathematicsKurt von Fritz — Kluwer (Springer) — 2004
- 79BookDisquisitiones ArithmeticaeCarl Friedrich Gauss — Springer — 1966
- 80Elementary Proof of the Prime Number Theorem: a Historical PerspectiveDorian M. Goldfeld — 2003
- 81BookThe Shaping of Arithmetic after C.F. Gauss's "Disquisitiones Arithmeticae"Catherine Goldstein et al. — Springer — 2007
- 82BookThe Princeton Companion to MathematicsAndrew Granville — Princeton University Press — 2008
- 83BookLife of PythagorasPorphyry — Platonist Press — 1920
- 84BookThe Pythagorean Sourcebook and LibraryKenneth Sylvan Guthrie — Phanes Press — 1987
- 85BookAn Introduction to the Theory of NumbersGodfrey Harold Hardy et al. — Oxford University Press — 2008
- 86BookA History of Greek Mathematics, Volume 1: From Thales to EuclidThomas L. Heath — Clarendon Press — 1921
- 87BookReligion, Learning and Science in the 'Abbasid PeriodJ. F. P. Hopkins — Cambridge University Press — 1990
- 88PythagorasCarl A. Huffman — 8 August 2011
- 89BookAnalytic Number TheoryHenryk Iwaniec et al. — American Mathematical Society — 2004
- 90BookTheaetetusPlato — 1871
- 91BookFleeting Footsteps: Tracing the Conception of Arithmetic and Algebra in Ancient ChinaLay Yong Lam et al. — World Scientific — 2004
- 92BookElementary Introduction to Number TheoryCalvin T. Long — D.C. Heath and Company — 1972
- 93BookThe Mathematical Career of Pierre de Fermat, 1601–1665M. S. Mahoney — Princeton University Press — 1994
- 94Algebraic Number TheoryJ. S. Milne — 18 March 2017
- 95BookMultiplicative Number Theory: I, Classical TheoryHugh L. Montgomery et al. — Cambridge University Press — 2007
- 96BookA Commentary on Book 1 of Euclid's ElementsEuclid — Princeton University Press — 1992
- 97JournalMathematics in India: reviewed by David MumfordDavid Mumford — March 2010
- 98BookThe Exact Sciences in AntiquityOtto E. Neugebauer — Dover Publications — 1969
- 99BookMathematical Cuneiform TextsOtto E. Neugebauer et al. — American Oriental Society etc. — 1945
- 100Thales of MiletusPatricia O'Grady — The Internet Encyclopaedia of Philosophy — September 2004
- 101BookEncyclopedia of Physical Science and TechnologyRobert L. Page — 2003
- 102JournalThe Fragments of the Works of Ya'qub ibn TariqDavid Pingree et al. — 1968
- 103JournalThe Fragments of the Works of al-FazariD. Pingree et al. — 1970
- 104BookMathematics in IndiaKim Plofker — Princeton University Press — 2008
- 105BookSuanjing shi shu (Ten Mathematical Classics)Zhonghua shuju — 1963
- 106JournalIbn al-Haytham et le théorème de WilsonRoshdi Rashed — 1980
- 107JournalNeither Sherlock Holmes nor Babylon: a Reassessment of Plimpton 322Eleanor Robson — 2001
- 108BookAlberuni's India: An Account of the Religion, Philosophy, Literature, Geography, Chronology, Astronomy and Astrology of India, Vol. 1Eduard Sachau et al. — Kegan, Paul, Trench, Trübner & Co. — 1888
- 109BookA Course in ArithmeticJean-Pierre Serre — Springer — 1996
- 110BookHistory of Mathematics, Vol ID. E. Smith — Dover — 1958
- 111BookOeuvres de FermatPaul Tannery et al. — Imprimerie Gauthier-Villars et Fils — 1891
- 112BookLife of Pythagoras or, Pythagoric LifeIamblichus — J. M. Watkins — 1818
- 113BookLeonard Euler, Elements of AlgebraC. A. Truesdell — Springer-Verlag — 1984
- 114BookThe Genius of Euler: reflections on his life and workC. A. Truesdell — Mathematical Association of America — 2007
- 115BookEuler Through Time: A New Look at Old ThemesV. S. Varadarajan — American Mathematical Society — 2006
- 116JournalArchimedes' Cattle ProblemIlan Vardi — April 1998
- 117BookScience AwakeningBartel L. van der Waerden — Oxford University Press — 1961
- 118BookNumber Theory: an Approach Through History – from Hammurapi to LegendreAndré Weil — Birkhäuser — 1984
- 119Kubilyus (2018)Kubilyus — 2018
- 120Pomerance, Sárközy (1995) p. 969Pomerance, Sárközy — 1995
- 121Pomerance (2010)Pomerance — 2010
- 122Dunham (2025)Dunham — 2025