Arithmetic modulo $n$
students, have you ever noticed that clocks “reset” after $12$ hours? ⏰ If it is $11$ o’clock and $2$ hours pass, the time becomes $1$ o’clock, not $13$ o’clock. That idea of “wrapping around” is the heart of arithmetic modulo $n$. In this lesson, you will learn how to describe numbers by their remainders, how to work with arithmetic mod $n$, and why this is a key part of congruences in number theory.
What does arithmetic modulo $n$ mean?
Arithmetic modulo $n$ means we work with numbers and keep only their remainders after division by $n$. The number $n$ is called the modulus. For example, in arithmetic modulo $5$, the numbers $12$ and $2$ are treated as related because both leave the same remainder when divided by $5$.
We write this relationship using congruence notation. If two integers $a$ and $b$ leave the same remainder when divided by $n$, then we say
$$a \equiv b \pmod{n}$$
This means that $n$ divides the difference $a-b$. In other words, there is an integer $k$ such that
$$a-b=kn$$
This is the formal definition of congruence. It is one of the main ideas behind arithmetic modulo $n$.
A useful way to think about this is to imagine a circle of numbers, like the hours on a clock. After reaching the largest value, we start again from the beginning. That is exactly what happens in modular arithmetic. 🔁
Remainders and congruence classes
Let us look at modulo $4$. The possible remainders are $0,1,2,$ and $3. Every integer belongs to one of these remainder groups.
For example:
- $8 \equiv 0 \pmod{4}$
- $9 \equiv 1 \pmod{4}$
- $10 \equiv 2 \pmod{4}$
- $11 \equiv 3 \pmod{4}$
- $12 \equiv 0 \pmod{4}$
All numbers with the same remainder form a congruence class. In modulo $4$, the class of $0$ includes numbers like $\dots,-8,-4,0,4,8,12,\dots$
We can describe a congruence class using notation such as
$$[a] = \{x \in \mathbb{Z} : x \equiv a \pmod{n}\}$$
This means “the set of all integers congruent to $a$ modulo $n$.” These classes divide all integers into exactly $n$ groups.
For modulo $5$, the classes are represented by $[0],[1],[2],[3],$ and $[4]$. Even though the numbers inside each class are different, they behave the same way with respect to remainders modulo $5$.
This is important because arithmetic modulo $n$ often replaces large or complicated numbers with smaller, easier representatives. For example, $27 \equiv 2 \pmod{5}$, so when working modulo $5$, you can use $2$ instead of $27$. That makes calculations faster and cleaner. ✨
How addition and multiplication work modulo $n$
Arithmetic modulo $n$ follows familiar rules for addition and multiplication, but we reduce the answer to its remainder class.
If $a \equiv b \pmod{n}$ and $c \equiv d \pmod{n}$, then:
$$a+c \equiv b+d \pmod{n}$$
and
$$ac \equiv bd \pmod{n}$$
This tells us that congruence is preserved under addition and multiplication.
Example: addition modulo $7$
Suppose we want to compute
$$5+6 \pmod{7}$$
First add the numbers:
$$5+6=11$$
Then reduce $11$ modulo $7$:
$$11 \equiv 4 \pmod{7}$$
So,
$$5+6 \equiv 4 \pmod{7}$$
You can also reduce first:
$$5 \equiv 5 \pmod{7}, \quad 6 \equiv 6 \pmod{7}$$
Then
$$5+6 \equiv 11 \equiv 4 \pmod{7}$$
Both methods give the same answer.
Example: multiplication modulo $7$
Compute
$$4 \cdot 6 \pmod{7}$$
Multiply:
$$4 \cdot 6 = 24$$
Now reduce modulo $7$:
$$24 \equiv 3 \pmod{7}$$
So,
$$4 \cdot 6 \equiv 3 \pmod{7}$$
This kind of calculation is very useful in problems where big numbers appear, because you can simplify at every step.
Working with negative numbers
Modular arithmetic also works with negative integers. This can seem surprising at first, students, but it is just another way of describing the same remainder class.
For example, modulo $5$:
$$-1 \equiv 4 \pmod{5}$$
because
$$-1-4=-5$$
and $5$ divides $-5$.
Also,
$$-6 \equiv 4 \pmod{5}$$
since $-6$ and $4$ both leave remainder $4$ when divided by $5$.
A helpful way to find a positive representative is to keep adding $n$ until the number is between $0$ and $n-1$. For instance, modulo $8$:
$$-3 \equiv 5 \pmod{8}$$
because
$$-3+8=5$$
This is why negative numbers are not a problem in arithmetic modulo $n$. They just belong to the same congruence classes as some positive numbers.
A full example with congruence classes
Let us work in modulo $6$. The classes are represented by $0,1,2,3,4,$ and $5.
Suppose we want to compute
$$17+25 \pmod{6}$$
First reduce each number:
$$17 \equiv 5 \pmod{6}, \quad 25 \equiv 1 \pmod{6}$$
Then add the remainders:
$$5+1=6$$
Finally reduce again:
$$6 \equiv 0 \pmod{6}$$
So,
$$17+25 \equiv 0 \pmod{6}$$
You can also check by adding first:
$$17+25=42$$
and then
$$42 \equiv 0 \pmod{6}$$
The result is the same.
Now try multiplication:
$$17 \cdot 25 \pmod{6}$$
Reduce first:
$$17 \equiv 5 \pmod{6}, \quad 25 \equiv 1 \pmod{6}$$
Then multiply:
$$5 \cdot 1=5$$
So,
$$17 \cdot 25 \equiv 5 \pmod{6}$$
This example shows how modular arithmetic lets you replace large numbers by smaller ones without changing the answer modulo $n$.
Why arithmetic modulo $n$ matters in congruences
Arithmetic modulo $n$ is the everyday working system of congruences. The topic “congruences” is not just about writing a statement like
$$a \equiv b \pmod{n}$$
It is also about using this statement to do calculations, compare numbers, and solve problems.
For example, if
$$a \equiv b \pmod{n}$$
and
$$b \equiv c \pmod{n}$$
then
$$a \equiv c \pmod{n}$$
This shows that congruence is an equivalence relation. It groups integers into classes that behave consistently under arithmetic.
Arithmetic modulo $n$ is used in many real-world systems. Clocks are one example. Another is computer science, where numbers are often stored and processed in fixed sizes, so values “wrap around” after reaching a limit. This is a practical use of modular arithmetic, even if the computer is not literally doing clock math. 💻
Common mistakes to avoid
A common mistake is to think that
$$a \equiv b \pmod{n}$$
means $a=b$. That is not true. It only means the numbers differ by a multiple of $n$.
For example,
$$14 \equiv 2 \pmod{4}$$
but clearly
$$14 \neq 2$$
Another mistake is to forget to reduce the final answer. If you compute modulo $9$ and get $18$, you should simplify it to
$$18 \equiv 0 \pmod{9}$$
Also remember that the modulus must be a positive integer. The notation $\pmod{n}$ is used with $n>0$.
Finally, do not confuse the remainder itself with the congruence class. The remainder is one representative of a class, but the class includes infinitely many integers.
Conclusion
Arithmetic modulo $n$ is the study of numbers based on remainders after division by $n$. It gives us a compact way to talk about equality up to multiples of $n$ using the notation
$$a \equiv b \pmod{n}$$
students, you have seen that numbers in the same congruence class behave the same under addition and multiplication, that negative numbers can also be handled, and that modular arithmetic is the core practical tool inside the broader topic of congruences. Once you understand arithmetic modulo $n$, you can solve many number theory problems more efficiently and see patterns that ordinary arithmetic may hide. ✅
Study Notes
- Arithmetic modulo $n$ means working with remainders after division by $n$.
- The notation $a \equiv b \pmod{n}$ means $n$ divides $a-b$.
- Numbers with the same remainder belong to the same congruence class.
- The classes modulo $n$ can be represented by $0,1,2,\dots,n-1$.
- Addition and multiplication are compatible with congruence:
- If $a \equiv b \pmod{n}$ and $c \equiv d \pmod{n}$, then $a+c \equiv b+d \pmod{n}$.
- If $a \equiv b \pmod{n}$ and $c \equiv d \pmod{n}$, then $ac \equiv bd \pmod{n}$.
- Negative numbers can be rewritten using an equivalent positive remainder class.
- Congruence classes divide all integers into exactly $n$ groups.
- Arithmetic modulo $n$ is the computational side of the broader congruence topic.
