Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

3.3: Multiplicative Order and Applications

( \newcommand{\kernel}{\mathrm{null}\,}\)













In this section we prove two very useful results called Euler’s Theorem and Fermat’s Little Theorem (a special case of Euler’s). We do not follow the proof strategy of Euler and Fermat, however, instead using an approach inspired by abstract algebra and Lagrange’s Theorem in that subject.

First we need the

Definition: Multiplicative Order

Suppose nN and aZ satisfy n2 and gcd(a,n)=1. Then we define the multiplicative order of a in mod n (called just the order when the multiplicative and n can be understood from context) to be the smallest kN such that ak1(modn). The order of a in mod n is written ordn(a).

Let us verify something which should probably always be checked for a new definition:

Proposition 3.3.1

Given relatively prime numbers nN and aZ with n2, ordn(a) is well-defined.

Proof

The problem in the definition of ordn(a) might be that there might not be any value of kN at all for which ak1(modn).

But notice that this is a congruence, so we are really only concerned with the elements ak up to their congruence class.

So look at {[ap]npN} and imagine putting the natural numbers pN into different boxes based on what is the corresponding congruence class [ap]Z/nZ. Since there are infinitely many elements in N and only n elements in Z/nZn boxes – by the Pigeonhole Principle (Theorem 1.1.1) there must be two (actually, infinitely many pairs of) distinct values p,qN such that p and q end up in the same box, meaning [ap]=[aq]. Assume without loss of generality that p>q, so pqN.

We are given that gcd(a,n)=1, so by Corollary 2.2.1, a1 exists in mod n. Thus (3.3.1)apqap(a1)qaq(a1)qa01(modn) (replacing ap with aq in the middle of this congruence since we know that [ap]=[aq], which means apaq(modn)) and therefore the set of kN for which ak1(modn) is non-empty. The order is the smallest such value, which exists by the Well-Ordering Principle.

Here now is a theorem from abstract algebra (Lagrange’s Theorem) translated into the current context:

Theorem 3.3.1

Given relatively prime numbers nN and aZ, ordn(a)ϕ(n).

Proof

Start by looking at the congruence classes [a],[a2],[a3]. They go up to [aordn(a)]=[1] and then start to repeat, so the set (3.3.2)a={[aj]jN,jordn(a)} is a set of ordn(a) elements of Z/nZ (in group theory, this set a is called the cyclic subgroup of (Z/nZ) generated by a). Notice that because aordn(a)1(modn), [1]a. Also, since if a1 is the inverse of a mod n, (a1)k is the inverse of ak for kN, we see that a(Z/nZ).

To finish, we shall show that (Z/nZ) is made up of some number, say m, of pieces, which we shall call cosets, each of which is bijective with a. These pieces will thus all have ordn(a) elements, so mordn(a)=#((Z/nZ))=ϕ(n), from which our desired result follows.

A coset of a is a set of the form (3.3.3)xa={[x][aj]=[xaj]jN,jordn(a)} where [x](Z/nZ). We have observed that [1]a, so [x](Z/nZ), [x]xa, meaning that every congruence class [x](Z/nZ) is in some coset, i.e., (3.3.4)Z/nZ[x](Z/nZ)xa .

In fact, each coset xa is bijective with a. The bijection is the map fx:axa defined by fx([aj])=[xaj] for jN with jordn(a). This map is a bijection because it has an inverse fx1, coming from the inverse mod n of x.

Now suppose xa and ya are two cosets. I claim that either xa=ya or xaya=. For this, suppose xaya, so [z]xaya. That means that j,kN such that jordn(a), kordn(a), and [xaj]=[z]=[yak]. In other words, (3.3.5)xajyak(modn) . Without loss of generality, assume jk. Then if we multiply both sides of the above congruence by (a1)j, we have xyakj(modn). But this means that every element [xap]xa is can be expressed as [yap+kj]ya, and every element [yaq]ya is can be expressed as [xaq+jk]xa. Thus xa=ya.

That was a lot of work, but now we get the famous theorems of Fermat’s Little and of Euler very easily.

Theorem 3.3.2: Euler's Theorem

Say aZ and nN satisfy gcd(a,n)=1. Then aϕ(n)1(modn).

Proof

The previous theorem, Theorem 3.3.1, told us that ordn(a)ϕ(n), so mZ such that mordn(a)=ϕ(n). By the definition of order, this means (3.3.6)aϕ(n)amordn(a)(aordn(a))m1m1(modn).

Corollary 3.3.1: Fermat's Little Theorem

If p is a prime and aZ satisfies gcd(p,a)=1 then ap11(modp).

Proof

We have seen that for primes p, ϕ(p)=p1, so there is very little to do here.

Sometimes one sees Fermat’s Little Theorem in the following, different form:

Theorem 3.3.3: Alternative Fermat's Little Theorem

If p is a prime then aZ, apa(modp).

Proof

If gcd(a,p)=1, then by Fermat’s Little, ap11(modp). Multiplying both sides of this congruence by a yields the desired result.

If instead gcd(a,p)1, it must be that gcd(a,p)=p since that gcd is a divisor of p, which is prime. The gcd is also a divisor of a, so in fact pa. But then a and all its powers are congruent mod p to 0, so ap0a(modp).

Exercise 3.3.1

  1. What are the remainder when 15! is divided by 17 and the remainder when 2(26!) is divided by 29?
  2. We know 17 is prime (it’s just a wonderful number, isn’t it?). But just to be sure, use Wilson’s Theorem to prove it.
  3. Can we build a test for primality out of Fermat’s Little Theorem? If so, would it be better (more efficient) than one based on Wilson’s Theorem? How would it work? Write a clear, formal statement of your proposed primality test.
  4. If you know a programming language, write some code to try out your primality test. If not (or, in any case, after the programming), do a little research to see if this question has already been investigated and, if so, what was the conclusion. Give either a formal statement of the test and formal result describing its efficacy or a counter-example to your test that you found in the literature.
  5. Suppose p is an odd prime. Prove that if the quadratic congruence x2+10(modp) has a solution, then p1(mod4). [Hint: Apply Fermat’s Little Theorem to a solution a of the congruence, then multiply and divide by 2 in the power.]

This page titled 3.3: Multiplicative Order and Applications is shared under a CC BY-SA license and was authored, remixed, and/or curated by Jonathan A. Poritz.

Support Center

How can we help?