Determine all pairs of positive integers $(n, k)$ for which

$$
n !+n=n^{k}
$$

holds.

(Michael Reitmeir)

Answer. The only solutions are $(2,2),(3,2)$ and $(5,3)$.
From $n !+n>n$, we see immediately that $k \geq 2$ must hold. Dividing both sides of the equation by $n$, we get

$$
(n-1) !+1=n^{k-1}
$$

Since $(n-1) !$ is even for $n \geq 3$, in this case, the left side and thus also $n$ must be odd. We check $n=1,2,3,5$ and obtain the solutions $(2,2),(3,2)$, and $(5,3)$.

From now on, let $n \geq 7$. We get

$$
\begin{aligned}
(n-1) ! & =n^{k-1}-1 \\
& =\left(1+n+n^{2}+\cdots+n^{k-2}\right)(n-1) \\
\Longrightarrow \quad(n-2) ! & =1+n+n^{2}+\cdots+n^{k-2} .
\end{aligned}
$$

Since $n$ is odd and greater than 6, $n-1$ is even and greater than 2, so it is not a prime number. Additionally, $n-1$ is not the square of a prime number, as 4 is the only even prime square and $n-1 \geq 6$. Thus, we can write $n-1$ as $n-1=a b$ with $1<a, b<n-1$ and $a \neq b$. Consequently, $(n-2) !$ contains both $a$ and $b$ as separate factors and is therefore divisible by $a b=n-1$, so $(n-2) ! \equiv 0 \bmod (n-1)$. Furthermore, $n \equiv 1 \bmod (n-1)$, and thus

$$
0 \equiv 1+1+1^{2}+\cdots+1^{k-2} \equiv k-1 \bmod (n-1) \text {. }
$$

Therefore, $k-1$ is divisible by $n-1$, we write $k-1=l(n-1)$ for a positive integer $l$. The cases $k=1$ and thus $l=0$ have already been excluded. Hence, at least $k-1 \geq n-1$ holds.

However,

$$
(n-1) !=1 \cdot 2 \cdot 3 \cdots(n-1)<\underbrace{(n-1) \cdot(n-1) \cdots(n-1)}_{n-1 \text{ times}}=(n-1)^{n-1},
$$

and thus

$$
n^{k-1}=(n-1) !+1 \leq(n-1)^{n-1}<n^{n-1} \leq n^{k-1} \text {, }
$$

which leads to a contradiction. Therefore, there can be no further solutions.

(Michael Reitmeir)