section_path: Contributions to mathematics and physics/Number theory
section_name: Number theory
paragraph_text: Number theory
  
  Euler's interest in number theory can be traced to the influence of Christian Goldbach, his friend in the St. Petersburg Academy. Much of Euler's early work on number theory was based on the work of Pierre de Fermat. Euler developed some of Fermat's ideas and disproved some of his conjectures, such as his conjecture that all numbers of the form 2 2 n + 1 {\textstyle 2^{2^{n}}+1} (Fermat numbers) are prime.
  
  Euler linked the nature of prime distribution with ideas in analysis. He proved that the sum of the reciprocals of the primes diverges. In doing so, he discovered the connection between the Riemann zeta function and prime numbers; this is known as the Euler product formula for the Riemann zeta function.
  
  Euler invented the totient function φ(n), the number of positive integers less than or equal to the integer n that are coprime to n. Using properties of this function, he generalized Fermat's little theorem to what is now known as Euler's theorem. He contributed significantly to the theory of perfect numbers, which had fascinated mathematicians since Euclid. He proved that the relationship shown between even perfect numbers and Mersenne primes (which he had earlier proved) was one-to-one, a result otherwise known as the Euclid–Euler theorem. Euler also conjectured the law of quadratic reciprocity. The concept is regarded as a fundamental theorem within number theory, and his ideas paved the way for the work of Carl Friedrich Gauss, particularly Disquisitiones Arithmeticae. By 1772 Euler had proved that 2 − 1 = 2,147,483,647 is a Mersenne prime. It may have remained the largest known prime until 1867.
  
  Euler also contributed major developments to the theory of partitions of an integer.