# Prove $(x-y)(y-z)(z-x) = x-y \mod 3$ for $x,y,z$ integers s.t. $x+y+z =0$

I read in an article that claims that for points with natural coordinates on the plane $x+y+z=0$ it holds that $(x-y)(y-z)(z-x) = x-y \mod 3$.

The article is about combinatorics, though I highly doubt this claim has anything to do with combinatorics...

I can't think of a way to prove this, I have some knowledge in number theory (mostly things I saw when I studied groups and rings), and I can't think of anything that can help me understand this claim.

Please note that although the article claims this to be true there is a chance that it is not true...(that's why I'm checking)

If anyone have an idea I would like to hear it

-
This question makes me wonder if, in general, $$\prod_{i=0}^{n-1} (x_i - x_{(i+1) \bmod n}) \equiv \prod_{i=0}^{n-2} (x_i - x_{i+1}) \pmod n$$ or something. – user2468 Mar 19 '12 at 20:45
@Belgi: Given $x$ and $y$, we know $z$, so there are only $9$ cases modulo $3$. But the cases $x\equiv y \pmod{3}$ are trivial, so there are only $6$ cases left. Interchanging $x$ and $y$ changes the signs of both sides, so there are only $3$ cases to worry about, namely $x=0, y=1$; $x=0, y=-1$; $x=1, y=-1$. Calculate. – André Nicolas Mar 19 '12 at 20:57

Use $x+y+z=0$ to derive $z=-(x+y)$, and substitute that into your target identity. Simplify each factor, remembering that $-a\equiv 2a \pmod3$. That should give you $$(x-y)^3\equiv x-y \pmod3$$ which is an application of Fermat's little theorem.

-

One way to crack this is to notice that the problem as stated isn't symmetrical: $x,y,z$ enter symmetrically into the hypothesis $x+y+z=0$, and they enter symmetrically under cyclic permutations into the LHS of the conclusion $(x-y)(y-z)(z-x)$, but they enter asymmetrically into the RHS of the conclusion. This is suspicious, and deserves scrutiny. See, if the conclusion really does follow from the hypothesis, then you could replace $x,y,z$ with $y,z,x$; then the hypothesis would still hold, and the conclusion would be $$(x-y)(y-z)(z-x) \equiv y-z \pmod 3$$ which has the same LHS as the original conclusion but a different RHS. But this would mean that $x-y\equiv y-z\pmod 3$. Likewise, by replacing $x,y,z$ with $z,x,y$, we get that $x-y\equiv y-z\equiv z-x \pmod 3$.

So, if the statement is right, then it follows that $x-y\equiv y-z\equiv z-x \pmod 3$. A natural problem-solving maneuver at this point is to try to prove that secondary conclusion directly from the hypothesis, because maybe it's easier and maybe you'll notice something useful while you're doing it. Once you've done that, then you realize that you've reduced the original goal to proving that $(x-y)^3\equiv x-y\pmod 3$, and either you remember Fermat's Little Theorem or you check by brute force that $a^3\equiv a \pmod 3$.

The resulting proof is what appears in the other answers.

-

Hint $\rm\ mod\ 3\!:\ x+y+z = 0\ \Rightarrow\ x\!-\!y\: =\: y\!-\!z\: =\: z\!-\!x\:\! =: c\:$ so the equation is just $\rm\:c^3 = c$

-

Assume that $x+y+z=0\pmod{3}$ and compute $t=(x-y)(y-z)(z-x)\pmod{3}$ by getting rid of every occurrence of $z$.

First, $-z=x+y\pmod{3}$ and $2y=-y\pmod{3}$ hence $y-z=2y+x=x-y\pmod{3}$. Second, $z=-x-y\pmod{3}$ and $-2x=x\pmod{3}$ hence $z-x=x-y\pmod{3}$.

Thus, $t=(x-y)^3\pmod{3}$. Since $u^3=u\pmod{3}$ for every $u$, $t=x-y\pmod{3}$.

-