**Number theory** (or **arithmetic** or **higher arithmetic** in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Mathematics is the queen of the sciences—and number theory is the queen of mathematics."^{[13]} Number theorists study prime numbers as well as the properties of objects made out of integers (for example, rational numbers) or defined as generalizations of the integers (for example, algebraic integers).

Integers can be considered either in themselves or as solutions to equations (Diophantine geometry). Questions in number theory are often best understood through the study of analytical objects (for example, the Riemann zeta function) that encode properties of the integers, primes or other number-theoretic objects in some fashion (analytic number theory). One may also study real numbers in relation to rational numbers, for example, as approximated by the latter (Diophantine approximation).

The older term for number theory is arithmetic*. By the early twentieth century, it had been superseded by "number theory". ^{[1]} (The word "arithmetic" is used by the general public to mean "elementary calculations"; it has also acquired other meanings in mathematical logic, as in *Peano arithmetic

*, and computer science, as in*floating point arithmetic

*.) The use of the term*arithmetic

*for*number theory

*regained some ground in the second half of the 20th century, arguably in part due to French influence.*arithmetical

^{[2]}In particular,*is preferred as an adjective to*number-theoretic

*.*

# History

The table's layout suggests^{[17]} that it was constructed by means of what amounts, in modern language, to the identity

It is not known what these applications may have been, or whether there could have been any; Babylonian astronomy, for example, truly came into its own only later. It has been suggested instead that the table was a source of numerical examples for school problems.^{[20]}^{[3]}

While Babylonian number theory—or what survives of Babylonian mathematics that can be called thus—consists of this single, striking fragment, Babylonian algebra (in the secondary-school sense of "algebra") was exceptionally well developed.^{[21]} Late Neoplatonic sources^{[22]} state that Pythagoras learned mathematics from the Babylonians. Much earlier sources^{[23]} state that Thales and Pythagoras traveled and studied in Egypt.

The Pythagorean tradition spoke also of so-called polygonal or figurate numbers.^{[29]} While square numbers, cubic numbers, etc., are seen now as more natural than triangular numbers, pentagonal numbers, etc., the study of the sums
of triangular and pentagonal numbers would prove fruitful in the early modern period (17th to early 19th century).

We know of no clearly arithmetical material in ancient Egyptian or Vedic sources, though there is some algebra in both. The Chinese remainder theorem appears as an exercise ^{[30]} in *Sunzi Suanjing* (3rd, 4th or 5th century CE.)^{[31]} (There is one important step glossed over in Sunzi's solution:^{[4]} it is the problem that was later solved by Āryabhaṭa's Kuṭṭaka – see below.)

There is also some numerical mysticism in Chinese mathematics,^{[5]} but, unlike that of the Pythagoreans, it seems to have led nowhere. Like the Pythagoreans' perfect numbers, magic squares have passed from superstition into recreation.

Aside from a few fragments, the mathematics of Classical Greece is known to us either through the reports of contemporary non-mathematicians or through mathematical works from the early Hellenistic period.^{[32]} In the case of number theory, this means, by and large, *Plato* and *Euclid*, respectively.

While Asian mathematics influenced Greek and Hellenistic learning, it seems to be the case that Greek mathematics is also an indigenous tradition.

Eusebius, PE X, chapter 4 mentions of Pythagoras:

Aristotle claimed that the philosophy of Plato closely followed the teachings of the Pythagoreans,^{[34]} and Cicero repeats this claim: *Platonem ferunt didicisse Pythagorea omnia* ("They say Plato learned all things Pythagorean").^{[35]}

Euclid devoted part of his *Elements* to prime numbers and divisibility, topics that belong unambiguously to number theory and are basic to it (Books VII to IX of Euclid's Elements). In particular, he gave an algorithm for computing the greatest common divisor of two numbers (the Euclidean algorithm; *Elements*, Prop. VII.2) and the first known proof of the infinitude of primes (*Elements*, Prop. IX.20).

In 1773, Lessing published an epigram he had found in a manuscript during his work as a librarian; it claimed to be a letter sent by Archimedes to Eratosthenes.^{[36]}^{[37]} The epigram proposed what has become known as
Archimedes's cattle problem; its solution (absent from the manuscript) requires solving an indeterminate quadratic equation (which reduces to what would later be misnamed Pell's equation). As far as we know, such equations were first successfully treated by the Indian school. It is not known whether Archimedes himself had a method of solution.

Diophantus also studied the equations of some non-rational curves, for which no rational parametrisation is possible. He managed to find some rational points on these curves (elliptic curves, as it happens, in what seems to be their first known occurrence) by means of what amounts to a tangent construction: translated into coordinate geometry (which did not exist in Diophantus's time), his method would be visualised as drawing a tangent to a curve at a known rational point, and then finding the other point of intersection of the tangent with the curve; that other point is a new rational point. (Diophantus also resorted to what could be called a special case of a secant construction.)

While Diophantus was concerned largely with rational solutions, he assumed some results on integer numbers, in particular that every integer is the sum of four squares (though he never stated as much explicitly).

While Greek astronomy probably influenced Indian learning, to the point of introducing trigonometry,^{[38]} it seems to be the case that Indian mathematics is otherwise an indigenous tradition;^{[39]} in particular, there is no evidence that Euclid's Elements reached India before the 18th century.^{[40]}

Brahmagupta (628 CE) started the systematic study of indefinite quadratic equations—in particular, the misnamed Pell equation, in which Archimedes may have first been interested, and which did not start to be solved in the West until the time of Fermat and Euler. Later Sanskrit authors would follow, using Brahmagupta's technical terminology. A general procedure (the chakravala, or "cyclic method") for solving Pell's equation was finally found by Jayadeva (cited in the eleventh century; his work is otherwise lost); the earliest surviving exposition appears in Bhāskara II's Bīja-gaṇita (twelfth century).^{[43]}

Indian mathematics remained largely unknown in Europe until the late eighteenth century;^{[44]} Brahmagupta and Bhāskara's work was translated into English in 1817 by Henry Colebrooke.^{[45]}

In the early ninth century, the caliph Al-Ma'mun ordered translations of many Greek mathematical works and at least one Sanskrit work (the *Sindhind*,
which may ^{[46]} or may not^{[47]} be Brahmagupta's Brāhmasphuṭasiddhānta).
Diophantus's main work, the *Arithmetica*, was translated into Arabic by Qusta ibn Luqa (820–912).
Part of the treatise *al-Fakhri* (by al-Karajī, 953 – ca. 1029) builds on it to some extent. According to Rashed Roshdi, Al-Karajī's contemporary Ibn al-Haytham knew^{[48]} what would later be called Wilson's theorem.

Other than a treatise on squares in arithmetic progression by Fibonacci—who traveled and studied in north Africa and Constantinople—no number theory to speak of was done in western Europe during the Middle Ages. Matters started to change in Europe in the late Renaissance, thanks to a renewed study of the works of Greek antiquity. A catalyst was the textual emendation and translation into Latin of Diophantus' *Arithmetica*.^{[49]}

Pierre de Fermat (1607–1665) never published his writings; in particular, his work on number theory is contained almost entirely in letters to mathematicians and in private marginal notes.^{[50]} He wrote down nearly no proofs in number theory; he had no models in the area.^{[51]}

One of Fermat's first interests was perfect numbers (which appear in Euclid, *Elements* IX) and amicable numbers;^{[6]} these topics led him to work on integer divisors, which were from the beginning among the subjects of the
correspondence (1636 onwards) that put him in touch with the mathematical community of the day.^{[52]}

Fermat's work in arithmetic includes the following.

- In 1638, Fermat claimed, without proof, that all whole numbers can be expressed as the sum of four squares or fewer.
^{[53]} - Fermat's little theorem (1640),
^{[54]}stating that, if*a*is not divisible by a prime*p*, then^{[7]} - If
*a*and*b*are coprime, then is not divisible by any prime congruent to −1 modulo 4;^{[55]}and every prime congruent to 1 modulo 4 can be written in the form .^{[56]}These two statements also date from 1640; in 1659, Fermat stated to Huygens that he had proven the latter statement by the method of infinite descent.^{[57]} - Fermat posed the problem of solving as a challenge to English mathematicians (1657). The problem was solved in a few months by Wallis and Brouncker.
^{[58]}Fermat considered their solution valid, but pointed out they had provided an algorithm without a proof (as had Jayadeva and Bhaskara, though Fermat would never know this). He states that a proof can be found by descent. - Fermat states and proves (by descent) in the appendix to
*Observations on Diophantus*(Obs. XLV)^{[59]}that has no non-trivial solutions in the integers. Fermat also mentioned to his correspondents that has no non-trivial solutions, and that this could be proven by descent.^{[60]}The first known proof is due to Euler (1753; indeed by descent).^{[61]}

The interest of Leonhard Euler (1707–1783) in number theory was first spurred in 1729, when a friend of his, the amateur^{[8]} Goldbach, pointed him towards some of Fermat's work on the subject.^{[62]}^{[63]} This has been called the "rebirth" of modern number theory,^{[64]} after Fermat's relative lack of success in getting his contemporaries' attention for the subject.^{[65]} Euler's work on number theory includes the following:^{[66]}

*Proofs for Fermat's statements.*This includes Fermat's little theorem (generalised by Euler to non-prime moduli); the fact that if and only if ; initial work towards a proof that every integer is the sum of four squares (the first complete proof is by Joseph-Louis Lagrange (1770), soon improved by Euler himself^{[67]}); the lack of non-zero integer solutions to (implying the case*n=4*of Fermat's last theorem, the case*n=3*of which Euler also proved by a related method).*Pell's equation*, first misnamed by Euler.^{[68]}He wrote on the link between continued fractions and Pell's equation.^{[69]}*First steps towards analytic number theory.*In his work of sums of four squares, partitions, pentagonal numbers, and the distribution of prime numbers, Euler pioneered the use of what can be seen as analysis (in particular, infinite series) in number theory. Since he lived before the development of complex analysis, most of his work is restricted to the formal manipulation of power series. He did, however, do some very notable (though not fully rigorous) early work on what would later be called the Riemann zeta function.^{[70]}*Quadratic forms*. Following Fermat's lead, Euler did further research on the question of which primes can be expressed in the form , some of it prefiguring quadratic reciprocity.^{[71]}^{[72]}^{[73]}*Diophantine equations*. Euler worked on some Diophantine equations of genus 0 and 1.^{[74]}^{[75]}In particular, he studied Diophantus's work; he tried to systematise it, but the time was not yet ripe for such an endeavour—algebraic geometry was still in its infancy.^{[76]}He did notice there was a connection between Diophantine problems and elliptic integrals,^{[76]}whose study he had himself initiated.

In his *Disquisitiones Arithmeticae* (1798), Carl Friedrich Gauss (1777–1855) proved the law of quadratic reciprocity and developed the theory of quadratic forms (in particular, defining their composition). He also introduced some basic notation (congruences) and devoted a section to computational matters, including primality tests.^{[80]} The last section of the *Disquisitiones* established a link between roots of unity and number theory:

In this way, Gauss arguably made a first foray towards both Évariste Galois's work and algebraic number theory.

Starting early in the nineteenth century, the following developments gradually took place:

- The rise to self-consciousness of number theory (or
*higher arithmetic*) as a field of study.^{[82]} - The development of much of modern mathematics necessary for basic modern number theory: complex analysis, group theory, Galois theory—accompanied by greater rigor in analysis and abstraction in algebra.
- The rough subdivision of number theory into its modern subfields—in particular, analytic and algebraic number theory.

Algebraic number theory may be said to start with the study of reciprocity and cyclotomy, but truly came into its own with the development of abstract algebra and early ideal theory and valuation theory; see below. A conventional starting point for analytic number theory is Dirichlet's theorem on arithmetic progressions (1837),^{[83]} ^{[84]} whose proof introduced L-functions and involved some asymptotic analysis and a limiting process on a real variable.^{[85]} The first use of analytic ideas in number theory actually
goes back to Euler (1730s),^{[86]} ^{[87]} who used formal power series and non-rigorous (or implicit) limiting arguments. The use of *complex* analysis in number theory comes later: the work of Bernhard Riemann (1859) on the zeta function is the canonical starting point;^{[88]} Jacobi's four-square theorem (1839), which predates it, belongs to an initially different strand that has by now taken a leading role in analytic number theory (modular forms).^{[89]}

The history of each subfield is briefly addressed in its own section below; see the main article of each subfield for fuller treatments. Many of the most interesting questions in each area remain open and are being actively worked on.

# Main subdivisions

The term *elementary* generally denotes a method that does not use complex analysis. For example, the prime number theorem was first proven using complex analysis in 1896, but an elementary proof was found only in 1949 by Erdős and Selberg.^{[90]} The term is somewhat ambiguous: for example, proofs based on complex Tauberian theorems (for example, Wiener–Ikehara) are often seen as quite enlightening but not elementary, in spite of using Fourier analysis, rather than complex analysis as such. Here as elsewhere, an *elementary* proof may be longer and more difficult for most readers than a non-elementary one.

Number theory has the reputation of being a field many of whose results can be stated to the layperson. At the same time, the proofs of these results are not particularly accessible, in part because the range of tools they use is, if anything, unusually broad within mathematics.^{[91]}

*Analytic number theory* may be defined

- in terms of its tools, as the study of the integers by means of tools from real and complex analysis;
^{[83]}or - in terms of its concerns, as the study within number theory of estimates on size and density, as opposed to identities.
^{[92]}

Some subjects generally considered to be part of analytic number theory, for example, sieve theory,^{[9]} are better covered by the second rather than the first definition: some of sieve theory, for instance, uses little analysis,^{[10]} yet it does belong to analytic number theory.

The following are examples of problems in analytic number theory: the prime number theorem, the Goldbach conjecture (or the twin prime conjecture, or the Hardy–Littlewood conjectures), the Waring problem and the Riemann hypothesis. Some of the most important tools of analytic number theory are the circle method, sieve methods and L-functions (or, rather, the study of their properties). The theory of modular forms (and, more generally, automorphic forms) also occupies an increasingly central place in the toolbox of analytic number theory.^{[93]}

One may ask analytic questions about algebraic numbers, and use analytic means to answer such questions; it is thus that algebraic and analytic number theory intersect. For example, one may define prime ideals (generalizations of prime numbers in the field of algebraic numbers) and ask how many prime ideals there are up to a certain size. This question can be answered by means of an examination of Dedekind zeta functions, which are generalizations of the Riemann zeta function, a key analytic object at the roots of the subject.^{[94]} This is an example of a general procedure in analytic number theory: deriving information about the distribution of a sequence (here, prime ideals or prime numbers) from the analytic behavior of an appropriately constructed complex-valued function.^{[95]}

Number fields are often studied as extensions of smaller number fields: a field *L* is said to be an *extension* of a field *K* if *L* contains *K*.
(For example, the complex numbers *C* are an extension of the reals *R*, and the reals *R* are an extension of the rationals *Q*.)
Classifying the possible extensions of a given number field is a difficult and partially open problem. Abelian extensions—that is, extensions *L* of *K* such that the Galois group^{[11]} Gal(*L*/*K*) of *L* over *K* is an abelian group—are relatively well understood.
Their classification was the object of the programme of class field theory, which was initiated in the late 19th century (partly by Kronecker and Eisenstein) and carried out largely in 1900–1950.

An example of an active area of research in algebraic number theory is Iwasawa theory. The Langlands program, one of the main current large-scale research plans in mathematics, is sometimes described as an attempt to generalise class field theory to non-abelian extensions of number fields.

The central problem of *Diophantine geometry* is to determine when a Diophantine equation has solutions, and if it does, how many. The approach taken is to think of the solutions of an equation as a geometric object.

For example, an equation in two variables defines a curve in the plane. More generally, an equation, or system of equations, in two or more variables defines a curve, a surface or some other such object in *n*-dimensional space. In Diophantine geometry, one asks whether there are any *rational points* (points all of whose coordinates are rationals) or
*integral points* (points all of whose coordinates are integers) on the curve or surface. If there are any such points, the next step is to ask how many there are and how they are distributed. A basic question in this direction is: are there finitely
or infinitely many rational points on a given curve (or surface)? What about integer points?

Diophantine geometry should not be confused with the geometry of numbers, which is a collection of graphical methods for answering certain questions in algebraic number theory. *Arithmetic geometry*, on the other hand, is a contemporary term
for much the same domain as that covered by the term *Diophantine geometry*. The term *arithmetic geometry* is arguably used
most often when one wishes to emphasise the connections to modern algebraic geometry (as in, for instance, Faltings's theorem) rather than to techniques in Diophantine approximations.

# Other subfields

The areas below date from no earlier than the mid-twentieth century, even if they are based on older material. For example, as is explained below, the matter of algorithms in number theory is very old, in some sense older than the concept of proof; at the same time, the modern study of computability dates only from the 1930s and 1940s, and computational complexity theory from the 1970s.

Take a number at random between one and a million. How likely is it to be prime? This is just another way of asking how many primes there are between one and a million. Further: how many prime divisors will it have, on average? How many divisors will it have altogether, and with what likelihood? What is the probability that it will have many more or many fewer divisors or prime divisors than the average?

Much of probabilistic number theory can be seen as an important special case of the study of variables that are almost, but not quite, mutually independent. For example, the event that a random integer between one and a million be divisible by two and the event that it be divisible by three are almost independent, but not quite.

At times, a non-rigorous, probabilistic approach leads to a number of heuristic algorithms and open problems, notably Cramér's conjecture.

Let *A* be a set of *N* integers. Consider the set *A* + *A* = { *m* + *n* | *m*, *n* ∈ *A* } consisting of all sums of two elements of *A*. Is *A + A* much larger than *A*? Barely larger? If *A + A* is barely larger than *A*, must *A* have plenty of arithmetic structure, for example, does *A* resemble an arithmetic progression?

While the word *algorithm* goes back only to certain readers of al-Khwārizmī, careful descriptions of methods of solution are older than proofs: such methods (that is, algorithms) are as old as any recognisable mathematics—ancient Egyptian, Babylonian, Vedic, Chinese—whereas proofs appeared only with the Greeks of the classical period.

There are two main questions: "can we compute this?" and "can we compute it rapidly?". Anyone can test whether a number is prime or, if it is not, split it into prime factors; doing so rapidly is another matter. We now know fast algorithms for testing primality, but, in spite of much work (both theoretical and practical), no truly fast algorithm for factoring.

The difficulty of a computation can be useful: modern protocols for encrypting messages (for example, RSA) depend on functions that are known to all, but whose inverses (a) are known only to a chosen few, and (b) would take one too long a time to figure out on one's own. For example, these functions can be such that their inverses can be computed only if certain large integers are factorized. While many difficult computational problems outside number theory are known, most working encryption protocols nowadays are based on the difficulty of a few number-theoretical problems.

Some things may not be computable at all; in fact, this can be proven in some instances. For instance, in 1970, it was proven, as a solution to Hilbert's 10th problem, that there is no Turing machine which can solve all Diophantine equations.^{[98]} In particular, this means that, given a computably enumerable set of axioms, there are Diophantine equations for which there is no proof, starting from the axioms, of whether the set of equations has or does not have integer solutions. (We would necessarily be speaking of Diophantine equations for which there are no integer solutions, since, given a Diophantine equation with at least one solution, the solution itself provides a proof of the fact that a solution exists. We cannot prove, of course, that a particular Diophantine equation is of this kind, since this would imply that it has no solutions.)

# Applications

The number-theorist Leonard Dickson (1874–1954) said "Thank God that number theory is unsullied by any application". Such a view is no longer applicable to number theory.^{[99]} In 1974, Donald Knuth said "...virtually every theorem in elementary number theory arises in a natural, motivated way in connection with the problem of making computers do high-speed numerical calculations".^{[100]}
Elementary number theory is taught in discrete mathematics courses for computer scientists; on the other hand, number theory also has applications to the continuous in numerical analysis.^{[101]} As well as the well-known applications to cryptography, there are also applications to many other areas of mathematics.^{[102]}^{[103]}

# Prizes

The American Mathematical Society awards the *Cole Prize in Number Theory*. Moreover number theory is one of the three mathematical subdisciplines rewarded by the *Fermat Prize*.

# See also