# David M. Burton, Primes exercise

Find the values of $$n≥1$$ for which

$$n!+(n+1)!+(n+2)!$$ is a perfect square.

This problem is from the book ELEMENTARY NUMBER THEORY by DAVID M BURTON under the chapter Primes and their distribution.Here is the link: https://books.google.com/books/about/Elementary_Number_Theory.html?id=2dI3AwAAQBAJ

Any hints of how to solve it are welcome.

• $n=1$ works! ${}{}{}{}{}{}$ – mjw Feb 17 at 4:15
• Is there any scope of improvement in my post? Feel free to outline them – Jordan Lawson Feb 17 at 4:15
• @mjw The problem requires solutions other than 1 – Jordan Lawson Feb 17 at 4:17
• Seems that $n=1$ is the only solution. – mjw Feb 17 at 4:28

You have

\begin{equation}\begin{aligned} n! + (n+1)! + (n+2)! & = (n!)(1 + (n+1) + (n+1)(n+2)) \\ & = (n!)(n + 2 + (n^2 + 3n + 2)) \\ & = (n!)(n^2 + 4n + 4) \\ & = (n!)(n + 2)^2 \end{aligned}\end{equation}\tag{1}\label{eq1A}

Also, Bertrand's postulate states that for any $$m \gt 3$$, there's a prime number $$p$$ such that

$$m \lt p \lt 2m - 2 \tag{2}\label{eq2A}$$

If $$n \ge 6$$ in \eqref{eq1A} is even, there's an $$m \gt 3$$ such that $$n = 2m - 2$$ so then $$n + 2 = 2m$$. From \eqref{eq2A}, there's a prime $$p \gt m$$, but $$p \lt 2m - 2$$, so it's a factor in \eqref{eq1A}. However, you also have that $$2p \gt 2m$$ and, as such, there's only one factor of it in \eqref{eq1A}. This means that \eqref{eq1A} can't be a perfect square.

If $$n \ge 7$$ in \eqref{eq1A} is odd, there's an $$m \gt 3$$ such that $$n = 2m - 1$$ so then $$n + 2 = 2m + 1$$. As before, there's a prime $$p \gt m$$, but $$p \lt 2m - 1$$, so it's a factor in \eqref{eq1A}. However, $$2p \ge 2m + 2$$, so also as before, there's only one factor in \eqref{eq1A}, meaning it can't be a perfect square.

This just leaves checking for $$1 \le n \le 5$$, which give $$9$$, $$32$$, $$150$$, $$864$$ and $$5880$$, respectively. Thus, as mjw's comment says, $$n = 1$$ is the only solution as $$9 = 3^2$$.

Update: As you stated in the comment below, the solution above could've been a bit simpler & shorter since, in \eqref{eq1A}, as $$(n+2)^2$$ is already a square, it only needed to check for $$n!$$ being a perfect square.

• Very nice!${}{}{}{}{}{}$ – mjw Feb 17 at 4:33
• @mjw Thanks. I made a small mistake originally, which I've fixed. Also, out of curiosity, I wanted to check on the other possibilities myself, so I finished the rest of the answer at the same time. – John Omielan Feb 17 at 4:40
• I believe you could have just used the fact that $n!$ cannot be a perfect square – Jordan Lawson Feb 17 at 5:10
• @HowardDickson You're right. That would have made the answer a bit shorter and simpler. – John Omielan Feb 17 at 5:12