Interactive · 2 questions

Modulo Arithmetic : Fermat's Little Theorem and some miscellaneous theorems

Previous Part

I'm sure you've heard about Fermat's Last Theorem.

Don't worry, I'm not going to talk about that. Instead, Fermat's little theorem states that :

Choose one answer

Worth the struggle

Twenty minutes on one hard problem can teach more than ten easy exercises. These problems are worth staying with. These are real problems from the AMC 12, the national math competitions for middle and high school students, each with a worked solution on LIVE by Po-Shen Loh.

Read · 1 min

Fermat's Little Theorem (FLT), named as it is to distinguish it from Fermat's Last Theorem, is a very important theorem in number theory. FLT states the following:

If pp is a prime and pp does not divide aa, then: ap−1≡1(modp)a^{p-1}\equiv 1 \pmod{p}

This is by no means an obvious theorem, although you may have observed it if you play around with computing powers of numbers. For example, you may have noticed that all perfect 44th powers can only end in the digits 00, 11, 55, and 66. This is a direct consequence of FLT.

To prove FLT, consider the set a,2a,3a,...,(p−1)a{a, 2a, 3a, ..., (p-1)a}. We will prove that this set is a complete residue class modulo pp, meaning that it contains every remainder modulo pp except 00 exactly once.

It is clear that none of the elements in the set is congruent to 00 modulo pp. Assume, for the sake of contradiction, that ai≡aj(modp)ai\equiv aj \pmod{p} for 0<j<i<p0\lt j\lt i\lt p. Then, a(i−j)≡0(modp)a(i-j)\equiv 0 \pmod{p}, which is a contradiction. Therefore, all of the elements a,2a,3a,...,(p−1)a{a, 2a, 3a, ..., (p-1)a} are distinct modulo pp. Thus, since these p−1p-1 elements can only occupy p−1p-1 residue classes, each residue class must be occupied exactly once.

Since a,2a,3a,...,(p−1)a{a, 2a, 3a, ..., (p-1)a} is a complete residue class, it follows that: a×2a×3a×...×(p−1)a≡1×2×3×...×(p−1)(modp)a \times 2a \times 3a \times ... \times (p-1)a \equiv 1\times 2\times 3\times ... \times(p-1) \pmod{p} ap−1(p−1)!≡(p−1)!(modp)a^{p-1}(p-1)!\equiv (p-1)! \pmod{p} Since (p−1)!(p-1)! is relatively prime to pp, we may divide by (p−1)!(p-1)! in the above congruence to obtain: ap−1≡1(modp)a^{p-1}\equiv 1 \pmod{p} Thus, we have proved FLT.

An alternative statement of FLT states that, for a prime pp and any integer aa, ap≡a(modp)a^p\equiv a \pmod{p}

One way to prove this is to use induction. Note that, for a=0a=0, 0p≡0(modp)0^p\equiv 0 \pmod{p} is trivial. Now, assume that ap≡a(modp)a^p\equiv a \pmod{p}. We will prove that (a+1)p≡a+1(modp)(a+1)^p\equiv a+1 \pmod{p}.

By the Binomial Theorem, (a+1)p=ap+(pp−1)ap−1+(pp−2)ap−2+...+1(a+1)^p = a^p + \binom{p}{p-1}a^{p-1} + \binom{p}{p-2}a^{p-2} + ... + 1 It is easy to show that (px)\binom{p}{x} is divisible by pp for all 1≤x≤p−11\le x\le p-1. Therefore, (a+1)p≡ap+1(modp)(a+1)^p \equiv a^p + 1 \pmod{p} (a+1)p≡a+1(modp)(a+1)^p \equiv a+1 \pmod{p} This completes the induction.

Read · 1 min

Fermat's Little Theorem

Fermat's Little Theorem (FLT) is as follows:

a)a) For a pp and any integer a,a, ap≡a(modp)a^p \equiv a \pmod{p}

b)b) Furthermore, if p∤a,p \nmid a, then ap−1≡1(modp)a^{p-1} \equiv 1 \pmod{p}

In this explanation we will prove part a)a) of Fermat's Little Theorem by mathematical induction.

Base case

The base case where a=1a = 1 is easy to check. Indeed, 1p≡1(modp)1^{p} \equiv 1 \pmod{p}

Inductive Hypothesis

Now, fix a prime p,p, and suppose that for some integer a,a, ap≡a(modp)a^p \equiv a \pmod{p}

Inductive Step

We want to show that: (a+1)p≡(a+1)(modp)(a+1)^p \equiv (a+1) \pmod{p}

By the binomial theorem, we know that: (a+1)p=ap+(p1)ap−1+(p2)ap−2+⋯+(pp−1)a+1.(a+1)^p = a^p + \binom{p}{1} a^{p-1} + \binom{p}{2} a^{p-2} + \cdots + \binom{p}{p-1} a + 1.

Remember that (pk)=p!(p−k)!k!.\binom{p}{k} = \dfrac{p!}{(p-k)!k!}. Thus, for all 0<k<p,0 < k < p, we can see that p∣(pk).p \mid \binom{p}{k}. Equivalently, for all 0<k<p,0 < k < p, (pk)≡0(modp).\binom{p}{k} \equiv 0 \pmod{p}.

\\

So, (a+1)p=ap+(p1)ap−1+(p2)ap−2+⋯+(pp−1)a+1  ⟺  (a+1)p≡ap+0+0+⋯+0+1(modp)  ⟺  (a+1)p≡ap+1(modp)\begin{align} (a+1)^p &= a^p + \binom{p}{1} a^{p-1} + \binom{p}{2} a^{p-2} + \cdots + \binom{p}{p-1} a + 1\\ \iff (a+1)^p &\equiv a^p + 0 + 0 + \cdots + 0 + 1 \pmod{p}\\ \iff (a+1)^p &\equiv a^p + 1 \pmod{p}\\ \end{align}

But by our inductive hypothesis, ap≡a(modp).a^p \equiv a \pmod{p}. So, (a+1)p≡ap+1(modp)  ⟺  (a+1)p≡a+1(modp)\begin{align} (a+1)^p &\equiv a^p + 1 \pmod{p}\\ \iff (a+1)^p &\equiv a + 1 \pmod{p} \end{align}

That concludes the proof by induction. To prove part b)b) of Fermat's Little Theorem, simply divide both sides of ap≡a(modp)a^p \equiv a \pmod{p} by a.a. This is only valid when p∤a.p \nmid a.

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems