Chapter
Congruences and Remainders
Residue classes, linear congruences, compatible remainders, and olympiad-style remainder arguments.
Theory
1. Residue Classes
Modulo \(m\), every integer belongs to exactly one of the classes
\[ 0,1,2,\ldots,m-1. \]
For example, modulo \(5\), the integers split into five residue classes. The number \(23\) belongs to class \(3\), because \(23\equiv3\pmod5\).
2. Congruence as a Tool
The statement
\[ a\equiv b\pmod m \]
means that \(a-b\) is divisible by \(m\). This turns questions about large numbers into questions about small remainders.
3. Solving Linear Congruences
A congruence such as
\[ ax\equiv b\pmod m \]
is called a linear congruence. If \(\gcd(a,m)=1\), then \(a\) has an inverse modulo \(m\), and the congruence has exactly one solution modulo \(m\).
Example:
\[ 3x\equiv5\pmod7. \]
Since \(3\cdot5\equiv1\pmod7\), multiply both sides by \(5\):
\[ x\equiv25\equiv4\pmod7. \]
4. When Division Is Dangerous
In ordinary equations, we often divide both sides. In congruences, division is allowed only when the divisor is invertible modulo \(m\). For example,
\[ 2x\equiv2\pmod6 \]
cannot simply be divided by \(2\) to get \(x\equiv1\pmod6\). In fact, the solutions are
\[ x\equiv1,4\pmod6. \]
5. Compatible Remainders
Sometimes a number must satisfy several remainder conditions:
\[ n\equiv a\pmod m,\qquad n\equiv b\pmod k. \]
When \(m\) and \(k\) are small, we can list one residue class and test it in the other condition. This prepares for the Chinese Remainder Theorem later.
6. Remainder Arguments in Olympiad Problems
Remainders are useful for proving that something is impossible, finding the form of a number, or reducing many cases to a few. A good habit is to ask:
- Which modulus makes the expression simple?
- Which remainders are possible?
- Can a common divisor, square, or power force a contradiction?
Examples
Example 1. Residue Class
This example shows how a standard residue identifies the residue class of an integer modulo a fixed number.
Example 2. Negative Residue
This example reminds students that negative numbers also have standard residues between 0 and m-1.
Example 3. Equivalent Congruences
This example connects congruence notation with the divisibility condition behind it.
Example 4. Solve a Simple Congruence
This example shows how to solve a linear congruence by using an inverse modulo m.
Example 5. Two Solutions
This example shows how to solve a linear congruence by using an inverse modulo m.
Example 6. Compatible Remainders I
This example develops the habit of listing one residue class and checking the second condition.
Example 7. Polynomial Residue
This example shows how reducing the variable first makes polynomial remainders manageable.
Example 8. Congruent Squares
This example shows how a congruence identity can be proved by multiplying congruent quantities.
Problems
Problems
Ladders