Let $p$ be a prime number. Find a positive integer $a$ such that $k^{a} \equiv k^{-1}(\bmod p)$ for all integers $k$ not divisible by $p$.
We can take $a=p-2$. Indeed, by Fermat's theorem, for any integer $k$,

$$
k^{p-2} \cdot k \equiv k^{p-1} \equiv 1 \quad(\bmod p)
$$

Thus, we have $k^{p-2} \equiv k^{-1}(\bmod p)$.