Relevant For...

Euler's theorem is a generalization of Fermat's little theorem dealing with powers of integers modulo positive integers. It arises in applications of elementary number theory, including the theoretical underpinning for the RSA cryptosystem.

Let \(n\) be a positive integer, and let \(a\) be an integer that is relatively prime to \(n.\) Then
\[a^{\phi(n)} \equiv 1 \pmod n,\]
where \(\phi(n)\) is Euler's totient function, which counts the number of positive integers \(\le n\) which are relatively prime to \(n.\)

Suppose \(a\) is relatively prime to \(10.\) Since \(\phi(10)=4,\) Euler's theorem says that \(a^4 \equiv 1 \pmod{10},\) i.e. the units digit of \(a^4\) is always \(1.\) See the wiki on finding the last digit of a power for similar problems.

Contents

Proofs of the theorem

Here are two proofs: one uses a direct argument involving multiplying all the elements together, and the other uses group theory.

Proof using residue classes:

Consider the elements \( r_1, r_2, \ldots, r_{\phi(n)}\) of \( ({\mathbb Z}/n)^*,\) the congruence classes of integers that are relatively prime to \(n.\) For \(a\in ({\mathbb Z}/n)^*,\) the claim is that multiplication by \(a\) is a permutation of this set; that is, the set \( \{ ar_1, ar_2, \ldots, ar_{\phi(n)} \} \) equals \( ({\mathbb Z}/n)^*.\) The claim is true because multiplication by \( a\) is a function from the finite set \( ({\mathbb Z}/n)^* \) to itself that has an inverse, namely multiplication by \( 1/a \pmod n.\)

For example, let \(n=9, a=2.\) Then \( ({\mathbb Z}/n)^* = \{ 1,2,4,5,7,8\}.\) Multiplication by \( 2\) turns this set into \( \{2,4,8,1,5,7\}.\) So it permutes the elements of the set. (Multiplication by \( 5 = 1/2 \pmod 9\) is the inverse of this permutation.)

Now, given the claim, consider the product of all the elements of \( ({\mathbb Z}/n)^*.\) On one hand, it is \( r_1r_2\cdots r_{\phi(n)}.\) On the other hand, it is \( (ar_1)(ar_2)(\cdots)(ar_{\phi(n)}).\) So these products are congruent mod \(n\):
\[
\begin{align}
r_1r_2\cdots r_{\phi(n)} &\equiv (ar_1)(ar_2)(\cdots)(ar_{\phi(n)}) \\
r_1r_2\cdots r_{\phi(n)} &\equiv a^{\phi(n)} r_1r_2\cdots r_{\phi(n)} \\
1 &\equiv a^{\phi(n)}
\end{align}
\]
where cancellation of the \(r_i\) is allowed because they all have multiplicative inverses \(\pmod n.\)

The elements in \( ({\mathbb Z}/n)\) with multiplicative inverses form a group under multiplication, denoted \( ({\mathbb Z}/n)^*\). This group has \(\phi(n)\) elements. The subgroup consisting of the powers of \( a\) has \(d\) elements, where \(d\) is the multiplicative order of \(a\) (because the elements of the subgroup are \(1,a,a^2,\ldots,a^{d-1}.\))

An army of worker ants was carrying sugar cubes back to their colony. In there, the ants put 1 sugar cube into the first room, 2 into the second, 4 into the third, and doubling the amount so on until the \(101^\text{th}\) room.

Then the Queen ant decided to build bigger cubic blocks of \(5\times 5\times 5\) sugar cubes from all they had previously collected. How many sugar cubes would be remained after all these build-ups?

\[\large a^{11763}\equiv{a^3}\pmod{25725}\]

How many integers \(a\) with \(1\leq{a}\leq1000\) satisfy the congruency above?