Can n! be a Square Number?


I read about this simple yet interesting question the other day:

Can $n!$ be a square number?

Of course, here we implcitly assume that $n$ is a positive integer. Moreover, we’re aware of the trivial case when $n=1$ (and yes it holds in that case). The problem seems easy at first glance but turns out not at all. There are a bunch of ways for you to factorize $n!$ into prime numbers, to construct a pattern of products in the form of a square number, etc. Some may work, some not.

Original Problem

The best solution is given by the Bertrand’s postulate, which is a theorem that states for any positive integer $n>1$ we’ll always have at least one prime number $p$ s.t. $n<p<2n$. The proof is not easy and the statement is just as strong — With Bertrand’s postulate we know there’s always a prime $p$ that satifies $\lfloor n / 2\rfloor < p < n$ and thus in no way can we find another number $m<n$ that has factor $p$. Being a prime number, $p$ itself is not a square either, so we conclude $n!$ can never be a square number for any $n>1$.

Generalized Problem

Now that we’ve successfully arrived at a conclusion for $n!$, let’s try another problem that highly resembles the one we just solved:

Can product of $n$ consecutive integers be a square number?

Again we’re here neglecting the trivial cases when $n=1$ ‘cause that then is a problem of whether the only number is a square or not. When $n>1$, the resemblance is apparent: when we consider the first $n$ positive integers, the problem falls back to the first one. However, how are we gonna answer this question in general? An educated guess would be a “no” with the conclusion from the first problem and the straightforward observation for $n=2$. When $n=2$, we’re basically asking if $k\cdot(k+1)$ can be a perfect square for positive $k$. It can’t, because $k^2<k\cdot(k+1)<(k+1)^2$ and there’s simply no square number in between of two consecutive squares.

When $n=3$, it’s a little trickier but still we can handle it. Notice by Euclidean, $k$ is coprime with both $k-1$ and $k+1$ respectively and therefore also with $k^1-1$. This means $k$ shares no common factors with $k^2-1$. Hence the product of the two has no duplicate factors and cannot be a perfect square.

When $n=4$, let $x=k+1/2$ and we know the product can be written as

$$ \begin{align} (n-1)\cdot n\cdot (n+1)\cdot (n+2) &= \left(k-\frac{3}{2}\right)\left(k-\frac{1}{2}\right)\left(k+\frac{1}{2}\right)\left(k+\frac{3}{2}\right)\\&= \left(k^2-\frac{9}{4}\right)\left(k^2 - \frac{1}{4}\right) \\&= \left(k^2-\frac{5}{4} - 1\right)\left(k^2 - \frac{5}{4} + 1\right) = \left(k^2- \frac{5}{4}\right)^{!!2} - 1 \end{align} $$

and thus by Euclidean (again) this product cannot be a perfect square. What about $n=5$? What about larger and even general $n>1$? It turns out to be an extremely hard one to answer but luckily, Paul Erdös and John Selfridge gave a rigorous proof in their paper published back in 1975. The conclusion, namely that the product of any two or more consecutive positive integers is never a perfect square, is merely a special case of their first result. Actually, theorem 1 in the paper states that the product of two or more consecutive positive integers is never a power, i.e. can never be represented in the form of $p^t$ where both $p$ and $t$ are positive integers.