35298 topics: [ Equations in integers ] [Products and factorials]

Find all natural integer solutions of the equation $(n+2)!-(n+1)!-n!=n^{2}+n^{4}$.

#
The equation can be written as $n!((n+2)(n+1)-(n+1)-1)=n^{2}\left(n^{2}+1\right)$, or $n!(n+2) n=n^{2}\left(n^{2}+1\right)$.

Checking shows that $n=1$ is not a solution.

Let $n>1$. Write the equation as $(n-2)!(n+2)(n-1)=\left(n^{2}+1\right)$. From this, $n^{2}+1 \geq(n+2)(n-1)$.

Expanding the brackets, we get $n \leq 3$. Checking shows that $n=2$ does not work, but $n=3$ is a solution.

## Answer

$n=3$.