Inverses Modulo
1Introduction
We assume familiarity with congruences modulo a prime . In this handout we build a small theory of multiplicative inverses modulo and use it to solve problems.
2Theory
Throughout, denotes a prime.
2.1Recap
We freely use the following standard facts about congruences modulo :
- Congruences may be added, subtracted, and multiplied: if and , then and .
- Cancellation: if and , then .
- For any , the residues are a permutation of modulo .
- Fermat's Little Theorem: for any , we have .
- Order: the order of is the smallest positive integer with . It divides .
- Primitive root: there exists of order . Every equals for some .
2.2Inverses
Theorem 1
Existence and Uniqueness of InverseLet . Then there exists a unique residue with
We write for , and for .
Theorem 2
Inverses Add Like FractionsLet . Then for any , we have
just like normal fractions.
Theorem 3
Inverses Multiply Like FractionsLet . Then for any , we have
just like normal fractions.
3Problems
The problems below all benefit from the theory above — working with fractions modulo as if they were ordinary numbers. They are ordered roughly by difficulty.
Problem 1
WilsonLet be a prime. Prove that
1Hint
In the product , try to pair factors with their inverse. Which numbers do not have a pair?
2Hint
The numbers without the pair are those satisfying . Find them all.
Problem 2
Let be a prime. Prove that there exist integers , neither divisible by , with if and only if or .
1Hint
The condition rewrites as . So the question becomes: for which primes is a square modulo ?
2Hint
For one direction, raise the relation to the -th power. The left side becomes .
3Hint
Apply Fermat's Little Theorem to the left side. What does the resulting equation force on ?
4Hint
For the converse with , you need an explicit square root of modulo . A natural source: Wilson's theorem, .
5Hint
In the product , pair with . What does the result look like for ?
Problem 3
Let be a prime. Show that if , then and .
1Hint
Note that , so . Assume for contradiction that . This is similar to the previous problem.
2Hint
Raise to the -th power, which is a positive integer since . The left side becomes .
3Hint
Multiply both sides by to get . Apply Fermat's Little Theorem to conclude . Substitute this back.
Problem 4
Let be a prime and let be an integer. Prove that
1Hint
Expand the binomial coefficient as .
2Hint
Reduce each factor in the numerator modulo : . Aren't we left with something familiar?
Problem 5
Let be a prime. Show that if
then .
1Hint
Looking at this modulo , we have the sum of inverses of all possible non-zero values mod .
2Hint
Realize that this sum is actually the sum of all values from to , not necessarily in this order.
Problem 6
IMO 2005Determine all positive integers that are coprime to every term of the sequence
1Hint
Show that for every prime , some is divisible by . Then the only valid is .
2Hint
Small primes are easy: handles and handles . Focus on and try to choose depending on so that the four terms collapse.
3Hint
For , take . Then , , . Compute .
Problem 7
PolandLet be a prime with , and let for . Prove that
1Hint
For , factor . Isolate the term, which contributes .
2Hint
The product becomes . We need to calculate the numerator and denominator mod separately.
3Hint
It would be great if the product of all the numbers was actually something we could calculate.
Problem 8
Singapore 2012Let be an odd prime. Prove that
1Hint
Since , the left-hand side is . Now work on the right-hand side to get the hint.
2Hint
Expand , so .
3Hint
Use to rewrite each summand: .
4Hint
Apply from a previous problem to simplify.
5Hint
The right-hand side reduces to . Split this into even and odd , and use from a previous problem.
Problem 9
Show that for every prime ,
1Hint
Write . Pull out the factor in the numerator and the in to get .
2Hint
Factor each numerator term as , so .
3Hint
Expand modulo : only the constant and linear-in- terms survive, giving .
4Hint
By P4, , so .
Problem 10
Let be a prime and let be a positive integer with . Show that if
then .
1Hint
The claim is . The trick is to look for an such that multiplying every by shuffles the terms but rescales the whole sum.
2Hint
Use the assumption to find with . The trick is to consider a primitive root.
Problem 11
WolstenholmeLet be a prime. Show that if
then .
1Hint
Pair with .
2Hint
This gives . We need the right-hand factor to be divisible by .
3Hint
Modulo , . So it suffices that .
4Hint
Note , so . Can we now use a previous problem?