Wilson’s,
Fermat’s, and
Euler’s Theorems
Modular Inverses
October 10th, 2026
Modular Inverses
October 10th, 2026
Problem
Compare and . Can we cancel?
Solution
Theorem
If , then give all residues modulo , each once.
Proof
Example
Multiply each residue by and reduce modulo .
Definition and theorem
An inverse of modulo is a number with . It exists exactly when , and is unique modulo .
Proof
Problem
Solve .
Solution
Problem
Find , then solve .
Solution
Problem
Solve . Does have a solution?
Solution
Theorem
For an odd prime , the only solutions of are and .
Proof
Problem
Find by pairing inverse residues.
Solution
Theorem
For every prime , .
Proof
Theorem
For , if , then is prime.
Proof
Problem
Find the remainder when is divided by .
Solution
Problem
Let be prime. Prove that has a solution.
Solution
Theorem
If is prime and , then .
Proof
Theorem
For every prime and every integer , .
Proof
Problem
Find .
Solution
Problem
Prove that is composite.
Solution
Theorem
A nonconstant word of prime length has exactly distinct cyclic rotations.
Proof
Theorem
For a prime and every integer , .
Proof by counting
Lemma
If is prime and , then .
Proof and application
Problem
Does force to be prime?
Solution
Definition
is the number of integers with and .
Theorem
For a prime and an integer , .
Proof
Problem
Compute , using the prime divisors .
Solution
Theorem
If , then .
Theorem
If , with distinct primes , then .
Example
Problem
Compute and .
Solution
Theorem
If and , then .
Proof
Problem
Find the last two decimal digits of .
Solution
Problem
Prove whenever .
Solution
Corollary
If , then .
Proof
Problem
Call rich if has more than distinct prime divisors. Is the set of rich integers finite?
Proof