Power of Sum Modulo Prime

Theorem
Let $p$ be a prime number.

Then:
 * $\left({a + b}\right)^p \equiv a^p + b^p \pmod p$

Proof
From the Binomial Theorem:
 * $\displaystyle \left({a + b}\right)^p = \sum_{k \mathop = 0}^p \binom p k a^k b^{p-k}$

Also note that:
 * $\displaystyle \sum_{k \mathop = 0}^p \binom p k a^k b^{p-k} = a^p + \sum_{k \mathop = 1}^{p-1} \binom p k a^k b^{p-k} + b^p$

So:

Also see

 * Freshman's Dream


 * Prime Power of Sum Modulo Prime