Prove that $p-1 \mid p^k(p-2)+1$ How to prove that for prime numbers $p$ and natural numbers $k$, $$p-1 \mid p^k(p-2)+1$$ My initial approach is to check if the numerator is even since the denominator can either be 1 or an even number. Upon inspection, yes. If it is divisible, what could be the form of the divisor... Thanks..
 A: Rearrange:
$$p^k (p - 2) + 1 = p^k (p - 1) + 1 - p^k$$
So it suffices to check that $p - 1 | p^k - 1$. This can be proven by considering
$$p^k - 1 = (p - 1)(1 + p + p^2 + \dots + p^{k - 1})$$
A: For  integer $k\ge0,$ $$p^k-1\equiv0\pmod{p-1}$$  as Why $a^n - b^n$ is divisible by $a-b$?
Alternatively, observe that for integer $k\ge0,$ $$p^k=(p-1+1)^k=\sum_{0\le r\le k}\binom kr(p-1)^r=1+\sum_{1\le r\le k}\binom kr(p-1)^r\equiv1\pmod{p-1}$$ as Proof that a Combination is an integer
A: Think mod $p-1$:
$p\equiv1\pmod{p-1}$ and $p-2\equiv-1\pmod{p-1}$. Therefore,
$$
p^k(p-2)+1\equiv1^k(-1)+1\equiv0\pmod{p-1}
$$
That is, $p-1\mid p^k(p-2)+1$.
A: This is true in a much more general setting, not just for prime numbers and divisibility of natural numbers. Look at the polynomial $f(X) = X^k (X - 2) + 1$ (over whatever ring $R$ you like). Then $f(1) = 1^k (1 - 2) + 1 = 0$. Therefore $X - 1 \mid f(X)$. Plugging in a specific $x \in R$ then also gives $x - 1 \mid x^k (x - 2) + 1$.
A: In what follows, we assume that $p$ is a prime number and that $k$ is a nonnegative integer.
Still another way to prove that
$$p - 1 \mid {p^k}(p - 2) + 1$$
is by showing that
$$D(p^k) = \frac{{p^k}(p - 2) + 1}{p - 1}$$
where $D(x)$ is the arithmetic function called the deficiency of $x$, defined as
$$D(x) = 2x - \sigma(x)$$
and where $\sigma(x)$ is the sum of divisors of $x$.
