How much is 17 mod 3?
17 mod 3 equals 2 since dividing 17 by 3 gives a quotient of 5 and a remainder of 2. The remainder is the result of the modulus operation. In simpler terms, 17 mod 3 = 2.
What is a modulo operator?
The modulo operator is used to find the remainder during a division of two numbers. The operator is represented by the symbol % in most programming languages. It is also known as the remainder operator. As an example, 5 mod 2 returns 1.
How to calculate modulo division?
To calculate modulo division: subtract the divisor from the dividend until the resultant is less than the divisor.
Videos
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$.
Imagine a clock numbered 0,1,2,3,4,5,6 in the usual clockwise orientation. Then $7 \equiv 0 \pmod 7$: if you go 7 numbers clockwise, you're back where you started. Likewise, $-7 \equiv 0 \pmod 7$ (going a full rotation anticlockwise).
Then consider -8. That's a full rotation anticlockwise, plus one further anticlockwise rotation through angle $2\pi/7$. Where do you end up? At 6.