Why is $a \equiv (a$mod$m)$mod$m$

300 Views Asked by At

I tried doing an example where $a = 10$ and $m = 4$ but I get this

$10 \equiv (10 mod 4) mod 4$

$10 \equiv 2 mod 4$

$10 \equiv 0$ ??

Is that logic not correct? What am I doing wrong?

2

There are 2 best solutions below

1
On

If the percent sign is the modulus operator, as it is in some programming languages, $2\%4=2,$ not $0$ so $10 \equiv 2 \pmod 4$ and all is well

0
On

Note $\ a = \bar a + q\,m,\,\ $ for $\,\bar a = (a\bmod m),\, $ by dividing $\,a\,$ by $\,m\ $ [Division Algorithm]

Thus $\ a\equiv \bar a \pmod m\ $ by definition, $ $ i.e. since $\ m\mid a-\bar a\ $ by above.