Modular arithmetic keeps track of remainders rather than complete integer values. It is useful when positions repeat: days of the week, numbered slots, repeating patterns and the final digits of powers.
The arithmetic does not claim that different integers are equal. It records that they occupy the same position in a repeating cycle.
On this page
Separate a remainder from a congruence statement
For an integer and positive integer , denotes its least non-negative remainder. For example,
The relation says that the difference is divisible by 7. Both integers lie in the same residue class. They are not equal as integers.
For the main examples, . Modulo 1 there is only one residue class, because every integer has remainder zero. MathWorld’s congruence reference develops the relation and its arithmetic properties.
Understand the entire residue class
The class represented by 3 modulo 7 contains
Every member has the form for an integer . The representative 3 is a convenient label for the whole class, not its only member.
The seven classes represented by partition the integers: every integer belongs to exactly one class. Adding seven moves to a different integer in the same class.
Successive multiples of 3 modulo 7
Diagram explanation and exact data
The total after j steps is 3j. Reducing each total modulo 7 produces every residue once before returning to zero after seven steps.
| Step | Total | Residue modulo 7 |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 3 | 3 |
| 2 | 6 | 6 |
| 3 | 9 | 2 |
| 4 | 12 | 5 |
| 5 | 15 | 1 |
| 6 | 18 | 4 |
| 7 | 21 | 0 |
Add, subtract and multiply after reducing
Modulo 7, both 18 and 25 have remainder 4. Their sum can therefore be reduced using small numbers:
Their product gives a different result:
These rules work because adding or multiplying representatives changes the original result only by a multiple of the modulus. If and , then
The difference is divisible by . Repeated reduction is therefore exact, not an approximation.
Model a cycle with a stated starting position
Number weekdays Monday 0 through Sunday 6. Thursday is 3. Seventeen days after a Thursday has residue
so it is Sunday. Stating the numbering avoids an off-by-one error. “Seventeen days after” does not count the starting Thursday as day one.
Likewise, on a 12-hour clock, . The residue determines the clock face position but does not distinguish morning from afternoon or record how many full cycles passed. Remainder information deliberately discards that information.
Reduce large powers without expanding them
To calculate , find a short power that returns to 1:
Since ,
No enormous decimal integer was needed. For the final digit of , work modulo 10. The residues of successive positive powers repeat ; exponent 2026 has remainder 2 modulo the period 4, so the final digit is 9.
The modulus and the exponent’s period are different objects. You cannot generally reduce an exponent modulo the original modulus. Although , the powers and have different residues modulo 5.
Do not cancel a factor automatically
Ordinary integer equality allows cancellation of any non-zero multiplicative factor. Congruences need a stronger condition. For example,
because the two products differ by 6. But . Cancelling 2 while keeping modulus 6 loses information.
Cancellation modulo is valid when the cancelled factor is coprime to . Otherwise the modulus must be adjusted, or all possible solutions retained. Congruence in Number Theory explains this through modular inverses and greatest common factors.
Use residues to rule out impossible cases
Every integer is even or odd. If , then has remainder zero modulo 4. If , then
has remainder one. Thus an integer square cannot have remainder 2 or 3 modulo 4.
This is a general proof from the two possible parity cases, not merely a list of observed squares. Such a restriction can eliminate an impossible equation before a lengthy search. It is still a necessary condition: having remainder zero or one does not by itself prove that an integer is a square.
Practice questions
- Find the least non-negative remainder of modulo 5.
- Find without multiplying the original numbers first.
- Find and explain the reduction.
Check your answers
- It is 3 because .
- Reduce to , giving remainder 2.
- Since , .
Related topics
Congruence in Number Theory moves from calculating residues to solving equations involving them. Divisibility Rules applies the same arithmetic to decimal place value.
