(IMO 1999, P4)

Find all prime numbers $p$ and all integers $x$ such that $1 \leqslant x \leqslant 2 p$ and $x^{p-1}$ divides $(p-1)^{x}+1$
If $p=2, x=1$ or $x=2$ work. If $p=3, x=1$ or $x=3$ work. We now assume that $p \geqslant 5$. It is clear that $x=1$ is a solution for all $p$. If $x>1$, let $q$ be the smallest prime divisor of $x$. Since $(p-1)^{x}+1$ is odd, $q$ is odd. Thus, $(p-1)^{x} \equiv-1[q]$ and therefore $(p-1)^{2 x} \equiv 1[q]$. The order of $p-1$ modulo $q$ divides $2 x$ but not $x$, so it is even. By Fermat's Little Theorem, it also divides $q-1$. The only divisors of $2 x$ less than $q-1$ are 1 and 2, so the order is 2. We deduce that $p-1 \equiv-1[q]$ and thus $p=q$. Therefore, $p \mid x$. According to the Lifting The Exponent (LTE) lemma, we finally get

$$
0<(p-1) v_{p}(x) \leqslant v_{p}(x)+1
$$

Equality can only occur for $p=3$ and $v_{p}(x)=1$, i.e., $x=3$, which works well $\left(3^{2} \mid 2^{3}+1\right)$. Finally, the solutions are $(2,2),(3,3)$ and $(p, 1)$ for any prime number $p$.