# Show $m^p+n^p\equiv 0 \mod p$ implies $m^p+n^p\equiv 0 \mod p^2$

Let $p$ an odd prime. Show that $m^p+n^p\equiv 0 \pmod p$ implies $m^p+n^p\equiv 0 \pmod{p^2}$.

-
This is an exact duplicate, but I cannot easily find the prior question. –  Bill Dubuque Oct 15 '12 at 22:48

From little Fermat, $m^p \equiv m \pmod p$ and $n^p \equiv n \pmod p$. Hence, $p$ divides $m+n$ i.e. $m+n = pk$.

$$m^p + n^p = (pk-n)^p + n^p = p^2 M + \dbinom{p}{1} (pk) (-n)^{p-1} + (-n)^p + n^p\\ = p^2 M + p^2k (-n)^{p-1} \equiv 0 \pmod {p^2}$$

-

I will prove first the following:

Suppose that $a$ and $b$ are integers and $p$ is prime, such that $a,b\nmid p$. If $a^p\equiv b^p\pmod{p}$, then $a\equiv b\pmod{p}$

Proof:

From Fermat's theorem, we know $a^p\equiv a\pmod{p}$ and $b^p\equiv b\pmod{p}$, therefor, if $a^p\equiv b^p\pmod{p}$, then $a\equiv b\pmod{p}$

We ready to prove our main problem,

From our lemma above, we conclude that, $a^k\equiv b^k\pmod{p}$.

Now,

$$a^p-b^p=(a-b)(a^{p-1}+a^{p-2}b+...+b^{p-1})=(a-b)\sum^{p}_{k=1}a^{p-k}b^{k-1}$$

but,

$$b^{k-1}\equiv a^{k-1}\pmod{p}$$

Therefor,

$$\sum^{p}_{k=1}a^{p-k}b^{k-1}\equiv\sum^{p}_{k=1} a^{p-k}a^{k-1}=\sum^{p}_{k=1}a^{p-1}=pa^{p-1}\equiv 0\pmod{p}$$

So, $p\mid\sum^{p}_{k=1}a^{p-k}b^{k-1}$, and $p\mid (a-b)$, we get $p^2\mid (a^p-b^p)$.

-

Here I gave a simple proof of $\rm\ k\:|\:m^k-n^k\,\!\Rightarrow\:k\:|\:(m^k-n^k)/(m-n).\:$ Yours is the special case $\rm\:k = p,\,\ n\to -n.\:$ I encourage you to read the proof there since it lends conceptual insight. Namely it shows that this result about numbers is just a special case of the following well-known result about functions (here polynomials): a root $\rm\ x = a\$ of $\rm\ f(x)\$ has multiplicity $\rm > 1 \iff f\:'(a) \:=\: 0\:.\:$

-