# Finding out if an equation has a solution in $\mathbb{Z_3}$

Prove $x^n + y^n = z^n$ has solutions for $x, y, z \in \mathbb{Z_3}$ only for odd $n$.

So for example, $1^2 + 2^2 = 5$ and $5$ doesn't have a square root, which means it doesn't have a solution.

I showed $0^n$ and $1^n$ remain $0, 1$ respectively for all $n$. But $2$ can be either $1 \mod 3$ if it's raised to an even power e.g. $4, 16, 64$, etc.

However, if it's raised to an odd power, the results are $2, 8, 32$, etc. and so it's $2 \mod 3$.

I am stuck on how to continue.

I didn't understand your example: $\;1^2+0^2=2^2\;$ is a solution modulo three ... – DonAntonio Oct 3 '13 at 18:25
There are 3 possibilities for $x$, 3 for $y$, and 3 for $z$. What's stopping you from trying all the possibilities? – WillO Oct 3 '13 at 18:26
Hint: $2\equiv -1 \mod 3$ so $2^n\equiv 1$ for even $n$ and $2^n\equiv -1$ for odd $n$. – kedrigern Oct 3 '13 at 18:53
Since $(3m+x)^n \equiv x^n (mod 3)$ We only have to think about $x,y,z$ are either $0,1,2$. Since $2^n \equiv (-1)^n (mod 3)$, if n is odd, $2^n \equiv 2$, and if n is even, $2^n \equiv 1$. It's clear that $1^n \equiv 1 (mod 3)$ and $0^n \equiv 0 (mod 3)$ Thus, there's no solution when n is even but when n is odd.