All topics

s3.4

Modular Arithmetic

1,000 questions

Modular arithmetic deals with remainders. The expression ar(modb)a \equiv r \pmod{b} means that when aa is divided by bb, the remainder is rr. A key property is that you can perform algebra on the remainders themselves.

This is the basis for divisibility rules. For example, since 101(mod9)10 \equiv 1 \pmod{9}, any power of 10 is also congruent to 1. Therefore, a number n=dk10k++d1101+d0100n = d_k 10^k + \dots + d_1 10^1 + d_0 10^0 is congruent to the sum of its digits (dk++d0)(mod9)(d_k + \dots + d_0) \pmod{9}.

To solve problems like 'Find xx where x+39(mod5)x+3 \equiv 9 \pmod{5}', you can first simplify the known numbers: 94(mod5)9 \equiv 4 \pmod{5}. The problem becomes x+34(mod5)x+3 \equiv 4 \pmod{5}, which simplifies to x1(mod5)x \equiv 1 \pmod{5}.

Practise this