[Math] Relation between the units digit of dividend and divisor for getting the remainder

elementary-number-theory

I couldn't find any online source that validated this, so I thought I would put this up here.

Is it true that in order to determine the remainder of a very large number $n$ when divided with a particular number we could simply take the digit at the units of the large number and divide it by the divisor and that would give us the remainder ?

A simple example $\frac{1676}{5}$ means $\frac{6}{5}$ this means we get a remainder 1. Is this method valid ? Or is this for only certain cases and unsafe to use generally ?

Best Answer

It does not work in general; it only works then the divisor is $1$, $2$, $5$, or $10$ (the reason being that these numbers divide $10$).

For an example where it does not work, consider $27$ divided by $7$. If we only looked at $7$ on $27$, we would conclude that the remainder is $0$. But the remainder is $6$.

The reason it works for $5$ (and it would work for $1$, $2$, or $10$), is that if you divide by $10$, the remainder is precisely the units digit (the rightmost, or least-significant digit). And dividing by $5$ is the same as first dividing by $10$ and then dividing by $2$, so you can just look at the last digit. Similarly with division by $2$ and by $1$.

Similarly, to find the remainder when dividing something by $4$, you could just look at the last two digits, because $4$ divides $100$, but the last digit would not be enough (for example, $15$ leaves a remainder of $3$, but $5$ leaves a remainder of $1$).

In general, if the divisor $q$ divides $10^n$, then the remainder is the same as the remainder of the last $n$ digits of the original number.

All of this becomes very clear when you learn about modular arithmetic.