# Some Basics for RMO Number Theory: Congruences

I. The congruence notation:

It often happens that for the purposes of a particular calculation, two numbers which differ by a multiple of some fixed number are equivalent, in the sense that they produce the same result. For example, the value of $(-1)^{n}$ depends only on whether n is odd or even, so that two values of n which differ by a multiple of 2 give the same result. Or again, if we are concerned only with the last digit of a number, then for that purpose two numbers which differ by a multiple of 10 are effectively the same.

The congruence notation, introduced by Gauss, serves to express in a convenient form the fact that the two integers a and b differ by a multiple of a fixed natural number m. We say that a is congruent to b with respect to the modulus m, or in symbols, $a \equiv b {\pmod m}$

The meaning of this, then, is simply that $a-b$ is divisible by m. The notation facilitates calculations in which numbers differing by a multiple of m are effectively the same, by stressing the analogy between congruence and equality. Congruence, in fact, means “equality except for the addition of some multiple of m”.

A few examples of valid congruences are : $63 \equiv 0 {\pmod 3}$; $7 \equiv -1 {\pmod 8}$; $5^{2} \equiv -1 {\pmod {13}}$

A congruence to the modulus 1 is always valid, whatever the two numbers may be, since every number is a multiple of 1. Two numbers are congruent with respect to the modulus 2 if they are of the same parity, that is, both even or both odd.

Two congruences can be added, subtracted or multiplied together, in just the same way as two equations, provided all the congruences have the same modulus. If $a \equiv \alpha {\pmod m}$ and $b \equiv \beta {\pmod m}$

then: $a + b \equiv {\alpha + \beta} {\pmod m}$ $a - b \equiv {\alpha - \beta}{\pmod m}$ $ab \equiv {\alpha\beta} {\pmod m}$

The first two of these statements are immediate: for example, $(a+b) - (\alpha + \beta)$ is a multiple of m because $a- \alpha$ and $b - \beta$ are both multiples of m. The third is not quite so immediate because $ab - \alpha \beta = (a-\alpha)b$, and $a - \alpha$ is a multiple of m. Next, $ab \equiv \alpha \beta$, for a similar reason. Hence, $ab \equiv {\alpha \beta} {\pmod m}$.

A congruence can always be multiplied throughout by any integer; if $a \equiv {\alpha} {\pmod m}$ the10n $ka \equiv {k\alpha} {\pmod m}$. Indeed this is a special case of the third result above, where $b$ and $\beta$ are both k. But, it is not always legitimate to cancel a factor from a congruence. For example, $42 \equiv 12 {\pmod 10}$, but it is not permissible to cancel the factor 6 from the numbers 42 and 12, since this would give the false result $7 \equiv 2 {\pmod 10}$. The reason is obvious: the first congruence states that $42-12$ is a multiple of 10, but this does not imply that $\frac{1}{6}(42-12)$ is a multiple of 10. The cancellation of a factor from a congruence is legitimate if the factor is relatively prime to the modulus. For, let the given congruence be $ax \equiv ay {\pmod m}$, where is the factor to be cancelled, and we suppose that a is relatively prime to m. The congruence states that $a(x-y)$ is divisible by m, and hence, $(x-y)$ is divisible by m.

An illustration of the use of congruences is provided by the well-known rules for the divisibility of a number by 3 or 9 or 11. The usual representation of a number n by digits in the scale of 10 is really a representation of n in the form $n = a + 10b + 100c + \ldots$

where a, b, c, … are the digits of the number, read from right to left, so that a is the number of units, b the number of tens, and so on. Since $10 \equiv 1 {\pmod 9}$, we have also $10^{2} \equiv 1 {\pmod 9}$, and $10^3 \equiv 1 {\pmod 9}$, and so on. Hence, it follows from the above representation of n that $n \equiv {a+b+c+\ldots} {\pmod 9}$

In other words, any number n differs from the sum of its digits by a multiple of 9, and in particular n is divisible by 9 if and only if the sum of its digits is divisible by 9. The same applies with 3 in place of 9 throughout.

The rule for 11 is based on the fact that $10 \equiv -1 {\pmod 11}$ so that $10^2 \equiv {+1} {\pmod 11}$, and so on. Hence, $n \equiv {a-b+c- \ldots} {\pmod 11}$

It follows that n is divisible by 11 if and only if $a-b+c-\ldots$ is divisible by 11. For example, to test the divisibility of 958 by 11 we form 1-8+5-9, or -11. Since this is divisible by 11, so is 9581.

Ref: The Higher Arithmetic by H. Davenport, Eighth Edition, Cambridge University Press.

Cheers,

Nalin Pithwa.

# A Congruence Problem for RMO basics

Problem:

Find the solution of the congruence $x^{24}+7x \equiv 2 \pmod {13}$.

Solution:

It is clear that $x \equiv 0 \pmod {13}$ is not a solution. So, let $1 \leq x \leq 12$. Then, from Fermat’s Little Theorem, we have that $x^{12} \equiv 1 \pmod{13}$ and this is why $x^{24}= 1 \pmod{13}$. The congruence to be solved can therefore be reduced to $7x \equiv 1 \pmod{13}$which leads to solution $x \equiv 2 \pmod{13}$.

Nalin Pithwa