<s>[INST] Why is -8 $\equiv$ 6 mod 7? I read in a book that $-8 \equiv 6 \bmod 7$ which means that $-8$ and $6$ leave the same remainder when divided by $7.$
The remainder when $-8$ is divided by $7$ is $-1.$ But when $6$ is divided by $7,$ isn't the remainder $6$?
I recognise that we can write $7\cdot1 - 1=6$, so from here it seems that the remainder is $-1.$ Why is the above reasoning (remainder${}= 6$) incorrect?
 [/INST] The definition is $a\equiv b\mod n$ iff $n$ divides $a-b$.
Here $-8\equiv 6\mod 7$ since $7$ divides $-8-6 = -14$.

Another definition is that $a\equiv b\mod n$ iff both leave the same remainder modulo $n$. But note that the remainder is between $0$ and $n-1$.
Here $-8$ and $6$ have the same remainder $6$ modulo $7$, since $-8 = (-2)\cdot 7 + 6$.
</s>