# Euler's theorem

{{#invoke:Hatnote|hatnote}}
In number theory, **Euler's theorem** (also known as the **Fermat–Euler theorem** or **Euler's totient theorem**) states that if *n* and *a* are coprime positive integers, then

where φ(*n*) is Euler's totient function. (The notation is explained in the article Modular arithmetic.) In 1736, Euler published his proof of Fermat's little theorem,^{[1]} which Fermat had presented without proof. Subsequently, Euler presented other proofs of the theorem, culminating with "Euler's theorem" in his paper of 1763, in which he attempted to find the smallest exponent for which Fermat's little theorem was always true.^{[2]}

The converse of Euler's theorem is also true: if the above congruence is true, then *a* and *n* must obviously be coprime.

The theorem is a generalization of Fermat's little theorem, and is further generalized by Carmichael's theorem.

The theorem may be used to easily reduce large powers modulo *n*. For example, consider finding the ones place decimal digit of 7^{222}, i.e. 7^{222} (mod 10). Note that 7 and 10 are coprime, and φ(10) = 4. So Euler's theorem yields 7^{4} ≡ 1 (mod 10), and we get 7^{222} ≡ 7^{4 × 55 + 2} ≡ (7^{4})^{55} × 7^{2} ≡ 1^{55} × 7^{2} ≡ 49 ≡ 9 (mod 10).

In general, when reducing a power of *a* modulo *n* (where *a* and *n* are coprime), one needs to work modulo φ(*n*) in the exponent of *a*:

- if
*x*≡*y*(mod φ(*n*)), then*a*^{x}≡*a*^{y}(mod*n*).

Euler's theorem also forms the basis of the RSA encryption system, where the net result of first encrypting a plaintext message, then later decrypting it, amounts to exponentiating a large input number by *k*φ(*n*) + 1, for some positive integer *k*. Euler's theorem then guarantees that the decrypted output number is equal to the original input number, giving back the plaintext.

## Proofs

1. Euler's theorem can be proven using concepts from the theory of groups:^{[3]}
The residue classes (mod *n*) that are coprime to *n* form a group under multiplication (see the article Multiplicative group of integers modulo n for details.) Lagrange's theorem states that the order of any subgroup of a finite group divides the order of the entire group, in this case φ(*n*). If *a* is any number coprime to *n* then *a* is in one of these residue classes, and its powers *a*, *a*^{2}, ..., *a*^{k} ≡ 1 (mod *n*) are a subgroup. Lagrange's theorem says *k* must divide φ(*n*), i.e. there is an integer *M* such that *kM* = φ(*n*). But then,

2. There is also a direct proof:^{[4]}^{[5]} Let *R* = {*x*_{1}, *x*_{2}, ..., *x*_{φ(n)}} be a reduced residue system (mod *n*) and let *a* be any integer coprime to *n*. The proof hinges on the fundamental fact that multiplication by *a* permutes the *x*_{i}: in other words if *ax*_{j} ≡ *ax*_{k} (mod *n*) then *j* = *k*. (This law of cancellation is proved in the article Multiplicative group of integers modulo n.^{[6]}) That is, the sets *R* and *aR* = {*ax*_{1}, *ax*_{2}, ..., *ax*_{φ(n)}}, considered as sets of congruence classes (mod *n*), are identical (as sets - they may be listed in different orders), so the product of all the numbers in *R* is congruent (mod *n*) to the product of all the numbers in *aR*:

## See also

## Notes

- ↑ See:
- Leonhard Euler (presented: August 2, 1736; published: 1741) "Theorematum quorundam ad numeros primos spectantium demonstratio" (A proof of certain theorems regarding prime numbers),
*Commentarii academiae scientiarum Petropolitanae*,**8**: 141–146. - For further details on this paper, including an English translation, see: The Euler Archive.

- Leonhard Euler (presented: August 2, 1736; published: 1741) "Theorematum quorundam ad numeros primos spectantium demonstratio" (A proof of certain theorems regarding prime numbers),
- ↑ See:
- L. Euler (published: 1763) "Theoremata arithmetica nova methodo demonstrata" (Proof of a new method in the theory of arithmetic),
*Novi Commentarii academiae scientiarum Petropolitanae*,**8**: 74–104. Euler's theorem appears as "Theorema 11" on page 102. This paper was first presented to the Berlin Academy on June 8, 1758 and to the St. Petersburg Academy on October 15, 1759. In this paper, Euler's totient function, φ(*n*), is not named but referred to as "numerus partium ad*N*primarum" (the number of parts prime to*N*; that is, the number of natural numbers that are smaller than*N*and relatively prime to*N*). - For further details on this paper, see: The Euler Archive.
- For a review of Euler's work over the years leading to Euler's theorem, see: Ed Sandifer (2005) "Euler's proof of Fermat's little theorem"

- L. Euler (published: 1763) "Theoremata arithmetica nova methodo demonstrata" (Proof of a new method in the theory of arithmetic),
- ↑ Ireland & Rosen, corr. 1 to prop 3.3.2
- ↑ Hardy & Wright, thm. 72
- ↑ Landau, thm. 75
- ↑ See Bézout's lemma

## References

The *Disquisitiones Arithmeticae* has been translated from Gauss's Ciceronian Latin into English and German. The German edition includes all of his papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of the Gauss sum, the investigations into biquadratic reciprocity, and unpublished notes.

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}