How to work out $-1 \bmod 7$?

70 Views Asked by At

What is the working out for $-1 \bmod 7$?

I can do it if the numbers are positive just the negative throws me off.

5

There are 5 best solutions below

0
On

In mod 7, you can add 7 without changing the value

$$-1\equiv-1+7\pmod7$$

0
On

The "mod 7" operation means "how many more is this number from the next smallest multiple of $7$"? The next smallest multiple of $7$ below $-1$ is $-7$, and $-1$ is $6$ more than that.

0
On

This would be the same as with positive numbers, for example you know $$ 4\equiv_{7}11 $$

this is because $$ 11-7=4 $$

You use the fact that reducing $7$ still leaves you with a congruent number.

But we can write $$ 4+7=11 $$

to see that adding $7$ doesn't change it either so $$ -1+7\equiv_{7}6 $$

To be more general two numbers $a,b$ are equivalent mod $n$ if and only if $$ a-b=kn $$

for some integer $k$, we wrote it as $$ a=b+kn $$

for $a=-1,b=6,k=-1,n=7$

0
On

To compute $x \bmod 7$, recall that if $x$ is positive we keep subtracting 7 from $x$ until we get a number between 0 and 6. If $x$ is negative we keep adding 7 to $x$ until we get a number between 0 and 6. Thus $-1 \equiv -1+7=6 \bmod 7$.

0
On

Well $a \mod b = c$ if there exists a number $n \in \mathbb Z $ such that $bn + c = a$ and $c \in [0, b)$. To answer your question: $$ -1 \mod 7 = 6 $$

Why? Because for $n=-1, \quad 7 (-1)+6=-1$.

I'm guessing the confusion was whether you should think of $-1$ as $7 (-1)+6=-1$ or as $7 \times 0-1=-1$, but if you always keep in mind that the mod operator can only yield a value between $0$ and the divisor, you will always end up with the correct answer.