Problem 9.4. The positive integers $M$ and $n$ are such that $M$ is divisible by all positive integers from 1 to $n$ but it is not divisible by $n+1, n+2$ and $n+3$. Find all possible values of $n$.

Ivailo Kortezov
9.4. We shall prove that $n+1, n+2$ and $n+3$ are prime powers. Assume the contrary and let some of them has the form $a b$, where $a \geq 2, b \geq 2$ and $(a, b)=1$. Since $a b$ does not divide $M$, then $a$ or $b$ does not divide $M$. Let $a$ does not divide $M$. Then it follows that $a \geq n+1$, i.e. $a b-a \leq 2$. Since $a b-a=a(b-1) \geq 2$ for $a \geq 2, b \geq 2$, it follows that $a=2, b=2$, which contradicts to $(a, b)=1$.

Therefore $n+1, n+2$ and $n+3$ are prime powers. At least one of them is even, so it has the form $2^{x}$. Analogously, at least one of them is divisible by 3 , so it has the form $3^{y}$. By parity arguments we conclude that

$$
2^{x}=3^{y} \pm 1
$$

Case 1. Let $2^{x}=3^{y}+1$. Since $2^{x} \equiv 1(\bmod 3)$ for $x$ even and $2^{x} \equiv 2(\bmod 3)$ for $x$ odd, we see that $x=2 z$, where $z$ is a nonnegative integer, and $\left(2^{z}-\right.$ 1) $\left(2^{z}+1\right)=3^{y}$. Then $2^{z}-1$ and $2^{z}+1$ are powers of 3 , which is possible only for $z=1$. Therefore $3^{y}=3,2^{x}=4$, whence $n=1$ or $n=2$. These solutions are achieved for $M=1$ and $M=2$, respectively.

Case 2. Let $2^{x}=3^{y}-1$. We may assume that $x \geq 2$ because for $x=1$ we obtain one of the above answers for $n$. We have $3^{y} \equiv 1(\bmod 4)$ for $y$ even and $3^{y} \equiv 3(\bmod 4)$ for $y$ odd. Therefore $y=2 z$ and $2^{x}=\left(3^{z}-1\right)\left(3^{z}+1\right)$. Then $3^{z}-1$ and $3^{z}+1$ are powers of 2 which is possible only for $z=1$. Therefore
$3^{y}=9,2^{x}=8$, whence $n=6$ or $n=7$. The solution $n=6$ is achieved, for instance, if $M=60$. For $n=7$ we obtain $n+3=10$, which is not a prime power.

Finally, the solutions are $n=1, n=2$ and $n=6$.