Why are congruences interesting and important? When we talk about congruences we are talking about 'modulo'. They are important because, for instance, they are used within computing, for example within hash tables and RSA encryption. ISBN:s are based on them. Another area where they are used is in the construction of so called latin squares.
Let n be an integer. Two integers a and b are
congruent modulo n if they have the same principal remainfer
when they are divided by n.
Write a b (mod n).
17 and -3 are congruent modulo 20 as
17 = 020+17 and -3 = -1
20+17.
Note that an integer is congruent modulo n to
exactly one integer k in the range 0
k < n. (Why? Because the
principal remainder is unique.)
We can express congruence modulo n in a number of ways. For instance, if
a=kn+r and b=ln+r, then a-b=(k-l)n which means that a-b is divisible by n,
which can be written as
a - b 0 (mod n). If we let
k-l=t then a-b=tn so a=b+tn. The next theorem summarises these results.
Two integers a and b are congruent modulo n iff
Now that we know various ways to check if two integers are congruent modulo n, we will look at addition and multiplication of two integers modulo n.
As the definition indicates, when we are dealing with congruences, we are really dealing with 'remainders'. We will prove the next theorem by looking at remainders. It is useful to remember that a result which is true for congruences is also true for remainders.
Let n be a given positive integer and a,b,c be any integers. Then the following are true.
Also
Now we have some results, we will start manipulating congruences. We will find the remainder when some integers are multiplied together, then we will look at some division rules - do you know how to check if an integer is divisible by 9 or by 11 or by 4?
Find the remainder when 3865920357
is divided by 8.
We can find the remainder when an integer is divided by 8, by looking at the integer modulo 8.
38651 (mod 8) and
920357
5 (mod 8) so
3865
920357
1
5
5 (mod 8). Hence the remainder when
3865
920357
is divided by 8 is 5.
Find the principal remainder when 8754 =
8103 +
7
102 +
5
10 +
4 is divided by 9.
To find the remainder when an integer is divided by 9, we work modulo 9.
By the theorem on congruences above, (iv) we know that
10k 1k
1 (mod 9), as
10
1 (mod 9).
By part (v), a
10k
a
1 (mod 9), so
8
103
8 (mod 9),
7
102
7 (mod 9) and
5
10
5 (mod 9). By applying (iv), we have
Hence the remainder when 8754 is divided by 9 is 6.
If a 0 (mod n),
then a is divisible by n. We can use this to check if an
integer a is divisible by, for example, 9. Basically, we follow the
method in the example above.
If a 0 (mod 9),
then a is divisible by 9.
Let (akak-1...a2a1a0) 10 be the base 10 representation of a. Then
a | = | (akak-1...a2a1a0) 10 |
= | 10kak + 10k-1ak-1 + ... + 102a2 + 10a1 + a0 | |
![]() |
ak + ak-1 + ... +
a2 + a1 + a0 (mod 9) as
10k ![]() |
Hence 9 | a if and only if 9 | (ak + ak-1 + ... + a2 + a1 + a0), that is, the sum of its digits.