<s>[INST] Show that $1^7+7^7+13^7+19^7+23^7\equiv{0}\pmod{63}$ Show that $1^7+7^7+13^7+19^7+23^7\equiv{0}\pmod{63}$
According to Fermat's theorem:
$$1^7+7^7+13^7+19^7+23^7\equiv{1+7+13+19+23}\pmod{7}\equiv{63}\pmod{7}\equiv{0}\pmod{7}$$
Now we need to show: $1^7+7^7+13^7+19^7+23^7\equiv{0}\pmod{9}$ , but how??
 [/INST] Just as Fermat's theorem tells you that $x^6\equiv1\pmod{7}$, Euler's theorem (which generalizes Fermat's) tells you that $x^6\equiv1\pmod{9}$ whenever $\gcd(x,9)=1$. It follows that
$$1^7+7^7+13^7+19^7+23^7\equiv1+7+13+19+23\equiv0\pmod{9}.$$
</s>