Question: Find integers $q$ and $r$ such that $m = qd + r$, $0$ $\leq$ $r$ $<$ $d$.
Given: $m = -2$, $d = 5$.
This is what I have so far:
$-2 = 5q +r$
Dividing $2$ into $5$ gives $q = 2$ and $ r = 1$
So, then
$-2 = 5(2) + 1$
Because $-m$ is positive, we can write $-m = dq + r$:
$2 = 5(-2) + 1$
But since $r$ $\neq$ $0$, $m = d(-q) -r = d(-q) - r + d - d = d(-q-1) + (d-r)$
So, after plugging in, we have
$2 = 5(-3) +4$
Obviously, the left hand side of the equation does not equal the right hand side. I cannot seem to figure out what I am not doing right.