Let's determine all pairs of positive integers $(n, p)$ such that $p$ is prime, $n \leq 2p$, and $(p-1)^{n}+1$ is divisible by $n^{p-1}$.
It is evident that $n>1$, since $n=1$ is a solution for any prime $p$. Let $q$ be the smallest prime divisor of $n$, so $n=q^{\alpha} \cdot m$, where $q \vee m . q$ implies that $(q, m)=1$, and also that $m$ is odd. Then $q|n|(p-1)^{n}+1$, which means

$$
(p-1)^{q^{\alpha} \cdot m} \equiv-1 \quad(\bmod q)
$$

By Fermat's Little Theorem, $(p-1)^{q} \equiv p-1(\bmod q)$. Repeated application of this theorem gives

$$
(p-1)^{n} \equiv(p-1)^{m} \quad(\bmod q), \quad \text { and thus }(p-1)^{m} \equiv-1 \quad(\bmod q) .(1)
$$

From this, it follows that $(q, p-1)=1$, so using Fermat's Little Theorem again,

$$
(p-1)^{q-1} \equiv 1 \quad(\bmod q)
$$

Squaring (1),

$$
(p-1)^{2 m} \equiv 1 \quad(\bmod q)
$$

If $d$ denotes the greatest common divisor of $q-1$ and $2 m$, then using the Euclidean algorithm, from (2) and (3) it follows that $(p-1)^{d} \equiv 1(\bmod q)$.

To determine $d$, note that by the choice of $q$, every prime divisor of $m$ is greater than $q$, so $q-1$ and $m$ have no common prime divisors. Thus $d=(q-1,2 m)$ is either 1 or 2. Therefore, $(p-1)^{2} \equiv 1(\bmod q)$

This holds precisely when $p-1 \equiv 1(\bmod q)$, or $p-1 \equiv-1(\bmod q)$.

In the first case, from (1) we get $(p-1)^{m} \equiv 1 \equiv-1(\bmod q)$, so $q=2$ and thus $p \equiv 2(\bmod q)$ implies $p=2$. From the condition, $n=2$ follows, and thus we obtain the solution $p=2, n=2$.

In the second case, $p-1 \equiv-1(\bmod q)$, so $q \mid p$, and thus $q=p>2, n=p^{\alpha} \cdot m$, and from the condition,

$$
p^{\alpha(p-1)} \mid(p-1)^{n}+1
$$

follows.

We will show that the exponent of $p$ in the prime factorization of $(p-1)^{n}+1$ is exactly $\alpha+1$. From this, according to (4), $\alpha(p-1) \leq \alpha+1$, i.e., $\alpha \cdot(p-2) \leq 1$, so $\alpha=1$ and $p=3$ follow.

$1+(p-1)^{n}$, by the binomial theorem (since $n$ is odd):

$$
1+\sum_{k=0}^{n}(-1)^{n-k}\binom{n}{k} p^{k}=\underbrace{1-1}_{0}+\binom{n}{1} p+\sum_{k=2}^{n}(-1)^{n-k} \cdot\binom{n}{k} \cdot p^{k}
$$

The first term of the sum is $\binom{n}{1} p=p^{\alpha+1} \cdot m$, and we know that $p \vee m$. We claim that all subsequent terms are divisible by $p^{\alpha+2}$, and thus $1+(p-1)^{n}=p^{\alpha+1}(m+p \cdot K)$, and the second factor is indeed not divisible by $p$.

Let $k \geq 2$, and consider the $k$-th term $\left(n=p^{\alpha} \cdot m\right)$ :

$$
\binom{n}{k} p^{k}=\frac{n}{k}\binom{n-1}{k-1} \cdot p^{k}=\frac{p^{\alpha+k} \cdot m}{k}\binom{n-1}{k-1}
$$

If $p \geq 3$ and $k \geq 2$, then $p^{k-1}>k$ (this is evident by induction on $k$), and thus the exponent of the prime $p$ in the denominator $k$ is at most $k-2$. Since the exponent of $p$ in the product $p^{\alpha+k} \cdot m \cdot\binom{n-1}{k-1}$ can only be reduced by division by $k$, this exponent is indeed at least $\alpha+k-(k-2)=\alpha+2$.

In the second case, we have arrived at the conclusion that the prime $p$ can only be 3, and the condition then becomes

$$
n^{2} \mid 2^{n}+1
$$

It is known that this only holds for $n=1$ and $n=3$. This was the 3rd problem of the 1990 International Mathematical Olympiad in Beijing. The solution can be found on pages 442-444 of István Reiman's book "International Mathematical Olympiads 1959-1994" (Typotex Publishing, Budapest, 1997).

Remark. The condition $n \leq 2 p$ can naturally be used without the need for this reference.

Solution by Gergely Zábrádi