4. Determine for which natural numbers \( n \) the sum

$$
\frac{n}{1!}+\frac{n}{2!}+\ldots+\frac{n}{n!}
$$

is an integer.

(E. Kováč)
Solution. For $n=1,2,3$, the given sum equals the integers 1, 3, and 5, respectively. Let us assume further that $n>3$. By a simple rearrangement, we get

$$
\begin{aligned}
\frac{n}{1 !}+ & \frac{n}{2 !}+\ldots+\frac{n}{(n-2) !}+\frac{n}{(n-1) !}+\frac{n}{n !}= \\
& =\frac{n(n-1) \cdot \ldots \cdot 2+n(n-1) \cdot \ldots \cdot 3+\ldots+n(n-1)+n+1}{(n-1) !} .
\end{aligned}
$$

If the last fraction is an integer, then the number $n-1$ must be a divisor of its numerator. Therefore, the number $n-1$ is a divisor of the number $n+1$. Since the greatest common divisor of two numbers is a divisor of their difference, the greatest common divisor of the numbers $n-1$ and $n+1$ is a divisor of the number 2, so $n-1 \in\{1,2\}$, which contradicts the assumption $n>3$.

The given sum is an integer for natural numbers $n$ from the set $\{1,2,3\}$.