Number Theory • Topic 8
Modular Arithmetic
Modular arithmetic is "clock arithmetic." It simplifies number theory by ignoring multiples of a certain number .
Definition
Definition (Congruence)
Two integers and are congruent modulo , written , if divides their difference ().
Equivalently, and leave the same remainder when divided by .
Arithmetic Operations
If and :- Addition: .
- Subtraction: .
- Multiplication: .
- Exponentiation: (for integer ).
Warning (Division)
You can only divide by if .
is TRUE only if .
If , then .
Residue Classes
The set of integers modulo is denoted or . A complete residue system is .Practice Problems
Exercise (Problem 1)
Find the remainder when is divided by 7.
Exercise (Problem 2)
Show that a perfect square leaves a remainder of 0 or 1 when divided by 4.
Exercise (Problem 3)
Solve the congruence .