If $b \ge a$ and p is prime, then $(b-a)^p \equiv b^p-a^p \mod{p}$.

I know this:

$b^p = (b - a+a)^p \equiv (b-a)^p +a^p \mod{p} $.

After all help in this comments I wrote this, I want to know if is correct my answer like this?

\begin{align} b^p = (b -a +a)^p \equiv (b-a)^p +a^p \mod{p} \end{align} \begin{align} b^p \equiv (b-a)^p +a^p \mod{p} \end{align} So, we have that:

\begin{align} b^p\equiv a^p \mod{p} \leftrightarrow p | b^p -a^p \end{align}

and, \begin{align} b-a^p \equiv b -a \equiv b^p -a^p\mod{p} \to\\ (b-a)^p\equiv b^p-a^p \mod{p} \to \\ p| (b-a)^p - (b^p-a^p) \to \\ \end{align} $p|(b-a)^p \to p|(b-a)$ and $p|(b^p-a^p)$ So, we have that \begin{align} p | (b-a)^p - (b^p -a^p) \to (b-a)^p \equiv b^p -a^p. \end{align}

  • 5
    $\begingroup$ Show that for any $k\in \{1,\ldots ,p-1\}$, $p$ divides $\binom{p}{k}$. $\endgroup$ – Suzet Jun 21 '18 at 4:46
  • 3
    $\begingroup$ the result $(a + b)^p \equiv a^p + b^p$ (mod p) is sometimes called (for obvious reasons) "the freshman's dream". try expanding the LHS using the binomial theorem... $\endgroup$ – David Holden Jun 21 '18 at 4:48
  • 4
    $\begingroup$ You could use Fermat's Little Theorem on both sides of the congruence $\endgroup$ – David Diaz Jun 21 '18 at 4:48
  • 1
    $\begingroup$ Subtract $a^p $ from both sides. But how did you justify $(b-a+a)^p\equiv (b-a)^p+a^p $? $\endgroup$ – fleablood Jun 21 '18 at 6:13
  • 2
    $\begingroup$ Then why didn't you simply note that $(a - b)^p \equiv a^p + (-b)^p$. ANd if $p$ is an odd prime $(-b)^p \equiv - b^2$ and if $p =2$ then $a^p +b^p \equiv a^p - b^p$? $\endgroup$ – fleablood Jun 21 '18 at 17:51

You've done the hard part. Your intermediate result can be restated (by transitivity) as: $$b^p \equiv (b-a)^p + a^p\mod p$$

And (by symmetry) as: $$(b-a)^p + a^p\equiv b^p \mod p$$

Modular arithmetic has some useful universal properties. Specifically, you can add or subtract the same thing to both sides of the equation. In other words, you can treat the $\equiv$ as a $=$ and simplify your equation. See if you can find a way to finish in one step.

  • $\begingroup$ Thanks, I tried to answer using these properties. But I think is missing something, you could tell me if is correct? $\endgroup$ – Juliana Rodrigues Jun 21 '18 at 14:43
  • 1
    $\begingroup$ Splitting into cases is a valid approach. For this problem though, the proof can be completed with a single operation to both sides. Hint: You're trying to get $(b-a)^p$ alone on one side. $\endgroup$ – David Diaz Jun 21 '18 at 17:43
  • $\begingroup$ I got it, thank you a lot! $\endgroup$ – Juliana Rodrigues Jun 21 '18 at 21:43

Notice that in the binomial expansion of (b-a)^p each term other than the first and last has a coefficient that is of the form p!/k!(p-k)! Since p is prime, the numerator will always have a factor of p, which cannot be cancelled by any factor in the denominator (since all terms there are smaller than p). Hence, the coefficient of each internal term of the expansion is congruent to 0 mod p, and all the internal terms drop out leaving simply the first and last terms, which is the equality you seek to demonstrate.


I know this: $b^p = (b - a+a)^p \equiv (b-a)^p +a^p \mod{p}$

Well if you know that then just subtract $a^p$ from both sides:

$b^p -a^p\equiv (b-a)^p +a^p -a^p \equiv (b-a)^p\mod{p}$


But perhaps more simply:

By binomial expansion $(n + m)^k \equiv n^k + m^k \mod c$ so

$(b -a)^p \equiv b^p + (-a)^p\equiv b^p\pm a^p\mod p$. (With $\pm$ being $+$ if $p$ is even and $\pm$ being $-$ if $p$ is odd. And if $p = 2$ then $\pm$ could be either as $1 \equiv -1\mod 2$.)

As $p$ is prime, either $p$ is odd or $p$ is $2$.

  • $\begingroup$ Thanks! I was confused about this assignment, but now I really starting to understand. $\endgroup$ – Juliana Rodrigues Jun 21 '18 at 21:50

Theorem. If $p$ is prime then for every integer $x$ we have $x^p\equiv x \pmod p.$

Applying this with $x$ being $(b-a)$ or $b$ or $a,$ we have, modulo $p,$ $$(b-a)^p\equiv b-a\equiv b^p-a^p$$ where we have used the (basic) fact that $(b\equiv b^p \land a\equiv a^p)\implies b-a\equiv b^p-a^p.$

Without the above theorem we can apply the Binomial Theorem expansion of $(b-a)^p$ and use the property that $p$ divides $\binom {p}{j}$ when $p$ is prime and $1\leq j\leq p-1.$ However, to confirm this property, we need some elementary Number Theory ( in particular, unique prime decomposition) while the above Theorem is part of elementary Number Theory.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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