Fermat's Little Theorem

Fermat's Little Theorem (FℓT)

Theorem

For all prime numbers and integers not divisible by , we have

Corollary of Fermat's Little Theorem

Corollary

For all prime numbers and integers , we have

Examples

Example

What is the remainder when is divided by ?

Since , by FℓT,
Then, using CAM, and CP:

Since , by CTR, 10 is the remainder.

Example

Solve the congruence relation

Let .
By corollary of FℓT for all integers .

Since , from CAM and CP, we obtain:

for all integers .

Since , we obtain:

for all integers .

Since , we obtain:

for all integers .

Putting all there together, we get

for all integers .

Now, we can use a table to check the possible values of by solving the non-linear congruence

Therefore, the solutions are given by all integers such that or