Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from 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 can often be understood through the study of analytical objects, such as 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, as for instance how irrational numbers can be approximated by fractions (Diophantine approximation). Number theory is one of the oldest branches of mathematics alongside geometry. One quirk of number theory is that it deals with statements that are simple to understand but are very difficult to solve. Examples of this are Fermat's Last Theorem, which was proved 358 years after the original formulation, and Goldbach's conjecture, which remains unsolved since the 18th century. German mathematician Carl Friedrich Gauss (1777–1855) said, "Mathematics is the queen of the sciences—and number theory is the queen of mathematics." It was regarded as the example of pure mathematics with no applications outside mathematics until the 1970s, when it became known that prime numbers would be used as the basis for the creation of public-key cryptography algorithms. History. Number theory is the branch of mathematics that studies integers and their properties and relations. The integers comprise a set that extends the set of natural numbers formula_1 to include number formula_2 and the negation of natural numbers formula_3. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example, rational numbers), or defined as generalizations of the integers (for example, algebraic integers). Number theory is closely related to arithmetic and some authors use the terms as synonyms. However, the word "arithmetic" is used today to mean the study of numerical operations and extends to the real numbers. In a more specific sense, number theory is restricted to the study of integers and focuses on their properties and relationships. Traditionally, it is known as higher arithmetic. By the early twentieth century, the term "number theory" had been widely adopted. The term number means whole numbers, which refers to either the natural numbers or the integers. Elementary number theory studies aspects of integers that can be investigated using elementary methods such as elementary proofs. Analytic number theory, by contrast, relies on complex numbers and techniques from analysis and calculus. Algebraic number theory employs algebraic structures such as fields and rings to analyze the properties of and relations between numbers. Geometric number theory uses concepts from geometry to study numbers. Further branches of number theory are probabilistic number theory, combinatorial number theory, computational number theory, and applied number theory, which examines the application of number theory to science and technology. Origins. In recorded history, knowledge of numbers existed in the ancient civilisations of Mesopotamia, Egypt, China, and India. The earliest historical find of an arithmetical nature is the Plimpton 322, dated c. 1800 BC. It is a broken clay tablet that contains a list of Pythagorean triples, that is, integers formula_4 such that formula_5. The triples are too numerous and too large to have been obtained by brute force. The table's layout suggests that it was constructed by means of what amounts, in modern language, to the identityformula_6which is implicit in routine Old Babylonian exercises. It has been suggested instead that the table was a source of numerical examples for school problems. Plimpton 322 tablet is the only surviving evidence of what today would be called number theory within Babylonian mathematics, though a kind of Babylonian algebra was much more developed. Although other civilizations probably influenced Greek mathematics at the beginning, all evidence of such borrowings appear relatively late, and it is likely that Greek (the theoretical or philosophical study of numbers) is an indigenous tradition. The ancient Greeks developed a keen interest in divisibility. The Pythagoreans attributed mystical quality to perfect and amicable numbers. The Pythagorean tradition also spoke of so-called polygonal or figurate numbers. Euclid devoted part of his "Elements" to topics that belong to elementary number theory, including prime numbers and divisibility. He gave the Euclidean algorithm for computing the greatest common divisor of two numbers and a proof implying the infinitude of primes. The foremost authority in in Late Antiquity was Diophantus of Alexandria, who probably lived in the 3rd century AD. He wrote "Arithmetica", a collection of worked-out problems where the task is invariably to find rational solutions to a system of polynomial equations, usually of the form formula_7 or formula_8. In modern parlance, Diophantine equations are polynomial equations to which rational or integer solutions are sought.After the fall of Rome, development shifted to Asia, albeit intermittently. The Chinese remainder theorem appears as an exercise in "Sunzi Suanjing" (between the third and fifth centuries). The result was later generalized with a complete solution called "Da-yan-shu" () in Qin Jiushao's 1247 "Mathematical Treatise in Nine Sections." There is also some numerical mysticism in Chinese mathematics, but, unlike that of the Pythagoreans, it seems to have led nowhere. While Greek astronomy probably influenced Indian learning it seems to be the case that Indian mathematics is otherwise an autochthonous tradition. Āryabhaṭa (476–550 AD) showed that pairs of simultaneous congruences formula_9, formula_10 could be solved by a method he called "kuṭṭaka", or "pulveriser"; this is a procedure close to the Euclidean algorithm. Āryabhaṭa seems to have had in mind applications to astronomical calculations. Brahmagupta (628 AD) started the systematic study of indefinite quadratic equations—in particular, the Pell equation. A general procedure for solving Pell's equation was probably found by Jayadeva; the earliest surviving exposition appears in Bhāskara II's Bīja-gaṇita (twelfth century). In the early ninth century, the caliph al-Ma'mun ordered translations of many Greek mathematical works and at least one Sanskrit work. 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 – c. 1029) builds on it to some extent. According to Rashed Roshdi, Al-Karajī's contemporary Ibn al-Haytham knew what would later be called Wilson's theorem. Other than a treatise on squares in arithmetic progression by Fibonacci 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". Early modern number theory. French mathematician Pierre de Fermat (1607–1665) never published his writings but communicated through correspondence and wrote in marginal notes instead. His contributions to number theory brought renewed interest in the field in Europe. He conjectured Fermat's little theorem, a basic result in modular arithmetic, and Fermat's Last Theorem, , as well as proved Fermat's right triangle theorem. He also studied prime numbers, the four-square theorem, and Pell's equations. The interest of Leonhard Euler (1707–1783) in number theory was first spurred in 1729, when a friend of his, the amateur Christian Goldbach, pointed him towards some of Fermat's work on the subject. This has been called the "rebirth" of modern number theory, after Fermat's relative lack of success in getting his contemporaries' attention for the subject. He proved Fermat's assertions, including Fermat's little theorem; made initial work towards a proof that every integer is the sum of four squares; and specific cases of Fermat's Last Theorem. He wrote on the link between continued fractions and Pell's equation. He made the first steps towards analytic number theory. Three European contemporaries continued the work in elementary number theory. Joseph-Louis Lagrange (1736–1813) gave full proofs of the four-square theorem, Wilson's theorem, and developed the basic theory of Pell's equations. Adrien-Marie Legendre (1752–1833) stated the law of quadratic reciprocity. He also conjectured what amounts to the prime number theorem and Dirichlet's theorem on arithmetic progressions. He gave a full treatment of the equation formula_11 In his old age, he was the first to prove Fermat's Last Theorem for formula_12. Carl Friedrich Gauss (1777–1855) wrote "Disquisitiones Arithmeticae" (1801), which had an immense influence in the area of number theory and set its agenda for much of the 19th century. Gauss proved in this work the law of quadratic reciprocity and developed the theory of quadratic forms. He also introduced some basic notation to congruences and devoted a section to computational matters, including primality tests. He established a link between roots of unity and number theory. In this way, Gauss arguably made forays towards Évariste Galois's work and the area algebraic number theory. Maturity and division into subfields. Starting early in the nineteenth century, the following developments gradually took place: 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), whose proof introduced L-functions and involved some asymptotic analysis and a limiting process on a real variable. The first use of analytic ideas in number theory actually goes back to Euler (1730s), 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; 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). 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". Main subdivisions. Elementary number theory. Elementary number theory deals with the topics in number theory by means of basic methods in arithmetic. Its primary subjects of study are divisibility, factorization, and primality, as well as congruences in modular arithmetic. Other topics in elementary number theory include Diophantine equations, continued fractions, integer partitions, and Diophantine approximations. Arithmetic is the study of numerical operations and investigates how numbers are combined and transformed using the arithmetic operations of addition, subtraction, multiplication, division, exponentiation, extraction of roots, and logarithms. Multiplication, for instance, is an operation that combines two numbers, referred to as factors, to form a single number, termed the product, such as formula_13. Divisibility is a property between two nonzero integers related to division. An integer formula_14 is said to be divisible by a nonzero integer formula_15 if formula_14 is a multiple of formula_15; that is, if there exists an integer formula_18 such that formula_19. An equivalent formulation is that formula_15 divides formula_14 and is denoted by a vertical bar, which in this case is formula_22. Conversely, if this were not the case, then formula_14 would not be divided evenly by formula_15, resulting in a remainder. Euclid's division lemma asserts that formula_14 and formula_15 can generally be written as formula_27, where the remainder formula_28 accounts for the smallest positive leftover quantity. Elementary number theory studies divisibility rules in order to quickly identify if a given integer is divisible by a fixed divisor. For instance, it is known that any integer is divisible by 3 if its decimal digit sum is divisible by 3. A common divisor of several nonzero integers is an integer that divides all of them. The greatest common divisor (gcd) is the largest of such divisors. Two integers are said to be coprime or relatively prime to one another if their greatest common divisor, and simultaneously their only divisor, is 1. The Euclidean algorithm computes the greatest common divisor of two integers formula_29 by means of repeatedly applying the division lemma and shifting the divisor and remainder after every step. The algorithm can be extended to solve a special case of linear Diophantine equations formula_30. A Diophantine equation has several unknowns and integer coefficients. Another kind of Diophantine equation is described in the Pythagorean theorem, formula_31, whose solutions are called Pythagorean triples if they are all integers. Another kind of expression is the continued fraction, which writes a sum of an integer and a fraction whose denominator is another such sum. Elementary number theory studies the divisibility properties of integers such as parity (even and odd numbers), prime numbers, and perfect numbers. Important number-theoric functions include the divisor-counting function, the divisor summatory function and its modifications, and Euler's totient function. A prime number is an integer greater than 1 whose only positive divisors are 1 and the prime itself. A positive integer greater than 1 that is not prime is called a composite number. Euclid's theorem demonstrates that there are infinitely many prime numbers that comprise the set {2, 3, 5, 7, 11, ...}. The sieve of Eratosthenes was devised as an efficient algorithm for identifying all primes up to a given natural number by eliminating all composite numbers. Factorization is a method of expressing a number as a product. Specifically in number theory, integer factorization is the decomposition of an integer into a product of integers. The process of repeatedly applying this procedure until all factors are prime is known as prime factorization. A fundamental property of primes is shown in Euclid's lemma. It is a consequence of the lemma that if a prime divides a product of integers, then that prime divides at least one of the factors in the product. The unique factorization theorem is the fundamental theorem of arithmetic that relates to prime factorization. The theorem states that every integer greater than 1 can be factorised into a product of prime numbers and that this factorisation is unique up to the order of the factors. For example, formula_32 is expressed uniquely as formula_33 or simply formula_34. Modular arithmetic works with finite sets of integers and introduces the concepts of congruence and residue classes. A congruence of two integers formula_35 modulo formula_36 (a positive integer called the modulus) is an equivalence relation whereby formula_37 is true. Performing Euclidean division on both formula_14 and formula_36, and on formula_15 and formula_36, yields the same remainder. This written as formula_42. In a manner analogous to the 12-hour clock, the sum of 4 and 9 is equal to 13, yet congruent to 1. A residue class modulo formula_36 is a set that contains all integers congruent to a specified formula_28 modulo formula_36. For example, formula_46 contains all multiples of 6 incremented by 1. Modular arithmetic provides a range of formulas for rapidly solving congruences of very large powers. An influential theorem is Fermat's little theorem, which states that if a prime formula_47 is coprime to some integer formula_14, then formula_49 is true. Euler's theorem extends this to assert that every integer formula_36 satisfies the congruenceformula_51where Euler's totient function formula_52 counts all positive integers up to formula_36 that are coprime to formula_36. Modular arithmetic also provides formulas that are used to solve congruences with unknowns in a similar vein to equation solving in algebra, such as the Chinese remainder theorem. Analytic number theory. Analytic number theory, in contrast to elementary number theory, relies on complex numbers and techniques from analysis and calculus. Analytic number theory may be defined It studies the distribution of primes, behavior of number-theoric functions, and irrational numbers. Number theory has the reputation of being a field many of whose results can be stated to the layperson. At the same time, many of 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. The following are examples of problems in analytic number theory: the prime number theorem, the Goldbach conjecture, the twin prime conjecture, 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. Analysis is the branch of mathematics that studies the limit, defined as the value to which a sequence or function tends as the argument (or index) approaches a specific value. For example, the limit of the sequence 0.9, 0.99, 0.999, ... is 1. In the context of functions, the limit of formula_55 as formula_56 approaches infinity is 0. The complex numbers extend the real numbers with the imaginary unit formula_57 defined as the solution to formula_58. Every complex number can be expressed as formula_59, where formula_56 is called the real part and formula_61 is called the imaginary part. The distribution of primes, described by the function formula_62 that counts all primes up to a given real number, is unpredictable and is a major subject of study in number theory. Elementary formulas for a partial sequence of primes, including Euler's prime-generating polynomials have been developed. However, these cease to function as the primes become too large. The prime number theorem in analytic number theory provides a formalisation of the notion that prime numbers appear less commonly as their numerical value increases. One distribution states, informally, that the function formula_63 approximates formula_64. Another distribution involves an offset logarithmic integral which converges to formula_64 more quickly. The zeta function has been demonstrated to be connected to the distribution of primes. It is defined as the seriesformula_66that converges if formula_67 is greater than 1. Euler demonstrated a link involving the infinite product over all prime numbers, expressed as the identity formula_68Riemann extended the definition to a complex variable and conjectured that all nontrivial cases (formula_69) where the function returns a zero are those in which the real part of formula_70 is equal to formula_71. He established a connection between the nontrivial zeroes and the prime-counting function. In what is now recognised as the unsolved Riemann hypothesis, a solution to it would imply direct consequences for understanding the distribution of primes. 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. 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. Elementary number theory works with "elementary proofs", a term that excludes the use of complex numbers but may include basic 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. The term is somewhat ambiguous. For example, proofs based on complex Tauberian theorems, such as Wiener–Ikehara, are often seen as quite enlightening but not elementary despite using Fourier analysis, not complex analysis. Here as elsewhere, an "elementary" proof may be longer and more difficult for most readers than a more advanced proof. Some subjects generally considered to be part of analytic number theory (e.g., sieve theory) are better covered by the second rather than the first definition. Small sieves, for instance, use little analysis and yet still belong to analytic number theory. Algebraic number theory. An "algebraic number" is any complex number that is a solution to some polynomial equation formula_72 with rational coefficients; for example, every solution formula_56 of formula_74 is an algebraic number. Fields of algebraic numbers are also called "algebraic number fields", or shortly "number fields". Algebraic number theory studies algebraic number fields. It could be argued that the simplest kind of number fields, namely quadratic fields, were already studied by Gauss, as the discussion of quadratic forms in "Disquisitiones Arithmeticae" can be restated in terms of ideals and norms in quadratic fields. (A "quadratic field" consists of all numbers of the form formula_75, where formula_14 and formula_15 are rational numbers and formula_78 is a fixed rational number whose square root is not rational.) For that matter, the eleventh-century chakravala method amounts—in modern terms—to an algorithm for finding the units of a real quadratic number field. However, neither Bhāskara nor Gauss knew of number fields as such. The grounds of the subject were set in the late nineteenth century, when "ideal numbers", the "theory of ideals" and "valuation theory" were introduced; these are three complementary ways of dealing with the lack of unique factorization in algebraic number fields. (For example, in the field generated by the rationals and formula_79, the number formula_80 can be factorised both as formula_81 and formula_82; all of formula_83, formula_84, formula_85 and formula_86 are irreducible, and thus, in a naïve sense, analogous to primes among the integers.) The initial impetus for the development of ideal numbers (by Kummer) seems to have come from the study of higher reciprocity laws, that is, generalizations of quadratic reciprocity. 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". 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 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 nineteenth 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. Diophantine geometry. The central problem of Diophantine geometry is to determine when a Diophantine equation has integer or rational 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 -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 whether there are finitely or infinitely many rational points on a given curve or surface. Consider, for instance, the Pythagorean equation formula_87. One would like to know its rational solutions, namely formula_88 such that "x" and "y" are both rational. This is the same as asking for all integer solutions to formula_89; any solution to the latter equation gives us a solution formula_90, formula_91 to the former. It is also the same as asking for all points with rational coordinates on the curve described by formula_92 (a circle of radius 1 centered on the origin). The rephrasing of questions on equations in terms of points on curves is felicitous. The finiteness or not of the number of rational or integer points on an algebraic curve (that is, rational or integer solutions to an equation formula_93, where formula_94 is a polynomial in two variables) depends crucially on the genus of the curve. A major achievement of this approach is Wiles's proof of Fermat's Last Theorem, for which other geometrical notions are just as crucial. There is also the closely linked area of Diophantine approximations: given a number formula_56, determine how well it can be approximated by rational numbers. One seeks approximations that are good relative to the amount of space required to write the rational number: call formula_96 (with formula_97) a good approximation to formula_56 if formula_99, where formula_100 is large. This question is of special interest if formula_56 is an algebraic number. If formula_56 cannot be approximated well, then some equations do not have integer or rational solutions. Moreover, several concepts (especially that of height) are critical both in Diophantine geometry and in the study of Diophantine approximations. This question is also of special interest in transcendental number theory: if a number can be approximated better than any algebraic number, then it is a transcendental number. It is by this argument that and e have been shown to be transcendental. 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 is a contemporary term for the same domain covered by Diophantine geometry, particularly when one wishes to emphasize the connections to modern algebraic geometry (for example, in Faltings's theorem) rather than to techniques in Diophantine approximations. Other subfields. Probabilistic number theory starts with questions such as the following: Take an integer 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). How many prime divisors will have on average? What is the probability that it will have many more or many fewer divisors or prime divisors than the average? Combinatorics in number theory starts with questions like the following: Does a fairly "thick" infinite set formula_103 contain many elements in arithmetic progression: formula_14, formula_105? Should it be possible to write large integers as sums of elements of formula_103?There are two main questions: "Can this be computed?" and "Can it be computed 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. Fast algorithms for testing primality are now known, but, in spite of much work (both theoretical and practical), no truly fast algorithm for factoring. Applications. For a long time, number theory in general, and the study of prime numbers in particular, was seen as the canonical example of pure mathematics, with no applications outside of mathematics other than the use of prime numbered gear teeth to distribute wear evenly. In particular, number theorists such as British mathematician G. H. Hardy prided themselves on doing work that had absolutely no military significance. 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. This vision of the purity of number theory was shattered in the 1970s, when it was publicly announced that prime numbers could be used as the basis for the creation of public-key cryptography algorithms. Schemes such as RSA are based on the difficulty of factoring large composite numbers into their prime factors. These applications have led to significant study of algorithms for computing with prime numbers, and in particular of primality testing, methods for determining whether a given number is prime. Prime numbers are also used in computing for checksums, hash tables, and pseudorandom number generators. 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". Elementary number theory is taught in discrete mathematics courses for computer scientists. It also has applications to the continuous in numerical analysis. Number theory has now several modern applications spanning diverse areas such as: Further reading. Two of the most popular introductions to the subject are: Hardy and Wright's book is a comprehensive classic, though its clarity sometimes suffers due to the authors' insistence on elementary methods (Apostol 1981). Vinogradov's main attraction consists in its set of problems, which quickly lead to Vinogradov's own research interests; the text itself is very basic and close to minimal. Other popular first introductions are: Popular choices for a second textbook include: