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

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?

• Change the title It's weird looking – wesssg Dec 6 '16 at 3:38
• MathJax hint: if you put slashes before functions, you get the right font and spacing. For mod, \pmod get the modulus plus puts it all in parentheses, so 10 \pmod 4 gives $10 \pmod 4$. bmod omits the parentheses, so 10 \bmod 4 gives $10 \bmod 4$. If the modulus is multiple characters, put it in braces. – Ross Millikan Dec 6 '16 at 3:42

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
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.