Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}$.

share|cite|improve this question
This is an exact duplicate, but I cannot easily find the prior question. – Bill Dubuque Oct 15 '12 at 22:48
up vote 7 down vote accepted

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}$$

share|cite|improve this answer

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} $


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}$.




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


$$\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)$.

share|cite|improve this answer

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\:.\:$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.