0

Why is

$347 \bmod 6 = 5$

but

$-347 \bmod 6 = 1$

What is the difference?

the_prole
  • 159

2 Answers2

1

If $a\equiv b\pmod n$, then $(-a)\equiv (-b)\pmod n$. Thus $-347 \equiv -5 \equiv 1\pmod 6$.

choco_addicted
  • 8,786
  • 8
  • 24
  • 53
1

Hint:-

The basic difference lies here-

$(a-b)\neq(-a-b)\text{ or}-(a+b)$

$(347-5)=342$ but $(-347-1)=-348$ both of which are divisible by $6$.

Soham
  • 9,990