Exercise 851Number theory › CongruencesL1Added 3 Nov 2026
Solvability of $ax\equiv b\pmod n$
#linear congruence#gcd criterion#number of solutions
Statement
Show that has solutions iff , and in that case has exactly solutions modulo .
Hint
Let . Reduce to the coprime case by dividing by .
Show solutionHide solution
Solution
Necessity. If , then , so , hence .
Sufficiency. Suppose , say . Write , . Then with . Since is invertible mod , there is a unique solution .
Lifting. The solutions mod are : exactly solutions.
Conclusion. has solutions mod iff .