Why is $x^2 \equiv 1 \pmod{x+1}$ for $x > 0$?

66 Views Asked by At

One day my mind wandered off and came upon the following.

$x^2 \equiv 1 \pmod{x+1}~\forall x>0, x \in \mathbb{Z}$.

My markdown might be a little bit broken :)

I tested this out in Python for the first $1000$ values of $x$ and it seems to work out. In case my congruence is hard to understand, I just mean that the remainder of $\frac{x^2}{x+1}$ is $1.$

Can anyone provide any intuition for this property?

2

There are 2 best solutions below

1
On BEST ANSWER

You can think of mod $x+1$ as meaning $x = -1$, then $x^2 = (-1)^2 = 1$.

0
On

$a \equiv b \mod n$

If $n$ divides $a-b$ (hence $b-a$). Since $x^2-1=(x-1)(x+1)$, of course $x+1$ divides $x^2-1$.