Let $p>2$ be an odd number and let n be a positive integer. Prove that $p$ divides $$1^{p^n}+2^{p^n}+...+(p-1)^{p^n}.$$
Here is the solution:
Define $k = p^n$ and note that $k$ is odd. Then \begin{equation} \label{eq} d^k + (p-d)^k = p[d^{k-1}-d^{k-2}(p-d)+...+(p-d)^{k-1}]\qquad\text{[1]} \end{equation}
But how exactly the left part expands into the right part?
I would like to see how you get the right part of it from the left part: https://i.stack.imgur.com/QT9rz.jpg
You probably know this factorisation
$$x^n-1 = (x-1)(x^{n-1} + x^{n-2} + ... + x + 1)$$
There is also a homogeneous version, which you can get by substituting $x=a/b$ and multiplying through by $b^n$:
$$a^n-b^n = (a-b)(a^{n-1} + a^{n-2}b + a^{n-3}b^2 + ... + b^{n-1})$$
In this case we use $a=d$ and $b=-(p-d)$, as well as $n=k$.