Solving $n! + 3n = k^2$

Let $n$ and $k$ be integers.

Need to solve $n! + 3n = k^2$, where $n!$ denotes $n$ factorial.

I do not have any ideas about this equation, except I suppose the only $6$ roots are $(0,1), (0, -1), (1, 2), (1, -2), (4, 6),$ and $(4, -6)$

Can anybody prove that these are the only roots?


Solution 1:

Just a partial answer for now.

We can write our equation as: $$n\cdot\left((n-1)!+3\right)=k^2,$$ so, assuming that there is a prime $p$ such that $p\mid n$ and $\nu_p(n)\equiv{1}\pmod{2}$, then $p$ must divide $(n-1)!+3$. This can happen only if $p=3$. So we have only two chances: $n$ is a square or $3,27,243,\ldots$ times a square. The problems now boils down to finding the integers $m$ for which $$ m! + 3 = k^2\quad\text{or}\quad m!+3=3k^2. $$ The first case cannot occur if $m\geq 4$, since in such a case $m!+3\equiv 3\pmod{4}$ cannot be a square. If $m\geq 6$, the second case is equivalent to: $$2\cdot 4\cdot5\cdot\ldots\cdot m = (k-1)(k+1),$$ or (since $k$ must be odd) to: $$2\cdot5\cdot\ldots\cdot m = k(k+1).$$