Least power. Squares again

$a(a+1)(a+2)(a+3) + 1$ is a square for all $a\ge1$. Are there more products of $k$ consecutive positive integers plus a known $m$ number, that are always square:

$a(a+1)(a+2)(a+3)\cdots(a+k-1) + m$ is a square for all $a$ given $m$ and $k$? If the answer is negative, is there a way to prove it ?


In the paper http://www.mast.queensu.ca/~murty/poly2.pdf, it is proven that if a polynomial $P(x_1, x_2, \ldots , x_n) \in \mathbb{Z}[x_1, x_2, \ldots , x_n]$ is such that $P(n)$ is a perfect square for all choices of $x_1, x_2, \ldots , x_n$ with $|x_i| \leq c$, where $c$ is sufficiently large, then $P(x)$ must be the square of a polynomial.

The case $n=1$ is classical. I will briefly explain the proof of the following result. I believe it is also included in the paper I linked to above.

Theorem: Consider a polynomial $P(x) \in \mathbb{Z}[x]$. If $P(n)$ is a perfect square for all positive integers $n$, then $P(x)$ must be the square of a polynomial in $\mathbb{Z}[x]$

  1. For a non-constant polynomial $P(x)\in \mathbb{Z}[x]$, there are infinitely many primes $p$ such that $p \mid P(n)$ for some $n$.

  2. If $f(x), g(x) \in \mathbb{Z}[x]$ have no common root, then there exist polynomials $A(x), B(x) \in \mathbb{Z}[x]$ such that $A(x)f(x)+B(x)g(x)=R(f, g)$, where $R(f, g) \not =0$ is a constant (its actually the determinant of a matrix formed using the coefficients of $f, g$). In particular, if $f(x)$ has no repeated root, then we can take $g(x)=f'(x)$.

  3. There is unique factorisation in $\mathbb{Z}[x]$. We write $P(x)=g(x)^2h(x)$, where $h(x)$ is squarefree. Clearly if $h(x)$ is constant, it must be a square and we are done. Assume on the contrary that $deg(h) \geq 1$.

  4. By 2, $R(h, h') \not =0$. By 1, there is a prime $p$ dividing $h(n)$ for some $n$ such that $p$ is relatively prime to $R(h, h')$. Since $p \nmid R(h, h')=A(x)h(x)+B(x)h'(x)$, $p \nmid h'(n)$.

  5. Since $h(n+tp) \equiv h(n)+tph'(n) \pmod{p^2}$, $p \| h(n+tp)$ for some $t$. Then the power of $p$ dividing $P(n+tp)$ is odd, a contradiction, so we are done.

We proceed to finish off your problem. We have $x(x+1) \ldots (x+k-1)+m=f(x)^2$, $f(x) \in \mathbb{Z}[x]$. Clearly $k$ must be even. Write $k=2l$. We consider $l \geq 3$.

Substituting $x=0$ gives $m=f(0)^2$, so $x(x+1) \ldots (x+2l-1)=f(x)^2-f(0)^2=(f(x)-f(0))(f(x)+f(0))$.

Thus we must be able to partition $\{0, 1, \ldots , 2l-1\}$ into 2 sets $A=\{a_1, a_2, \ldots , a_l\}, B=\{b_1, b_2, \ldots , b_l\}$ such that $\prod\limits_{i=1}^{l}{(x+a_i)}-\prod\limits_{i=1}^{l}{(x+b_i)}=c$ for some constant $c$.

Edit: To clarify, because of unique factorisation in $\mathbb{Z}[x]$, we must have $f(x)+f(0)=\prod\limits_{i=1}^{l}{(x+a_i)}, f(x)-f(0)=\prod\limits_{i=1}^{l}{(x+b_i)}$ for some partition $\{0, 1, \ldots , 2l-1\}$ into 2 sets $A=\{a_1, a_2, \ldots , a_l\}, B=\{b_1, b_2, \ldots , b_l\}$. Thus the difference is a constant $c$.

WLOG assume $0 \in A$, and let $d$ be the smallest positive integer such that $d \in A$, so that $1, 2, \ldots , d-1 \in B$ (If $d=1$, we simply do not draw any conclusion about $B$).

WLOG assume $a_1=0, a_2=d$, and $b_i=i$ for $i=1, 2, \ldots , d-1$. Note that $b_i>d$ for $i \geq d$

Thus $x(x+d)\prod\limits_{i=3}^{l}{(x+a_i)}-\prod\limits_{i=1}^{d-1}{(x+i)}\prod\limits_{i=d}^{l}{(x+b_i)}=c$.

Substituting $x=0$ and taking absolute values gives $$|c|=\left|\prod\limits_{i=1}^{d-1}{i}\prod\limits_{i=d}^{l}{b_i}\right|$$

Substituting $x=-d$ and taking absolute values gives $$|c|=\left|\prod\limits_{i=1}^{d-1}{(-d+i)}\prod\limits_{i=d}^{l}{(-d+b_i)}\right|=\left|(-1)^{d-1}\prod\limits_{i=1}^{d-1}{i}\prod\limits_{i=d}^{l}{(-d+b_i)}\right|\leq\left|\prod\limits_{i=1}^{d-1}{i}\prod\limits_{i=d}^{l}{b_i}\right|=|c|$$

Thus equality holds, so the product $\prod\limits_{i=d}^{l}{(-d+b_i)}$ must be empty, so $d>l$, so $B=\{1, 2, \ldots , l\}$, so $A=\{0, l+1, l+2, \ldots , 2l-1\}$.

Comparing coefficient of $x^{l-1}$ in $\prod\limits_{i=1}^{l}{(x+a_i)}-\prod\limits_{i=1}^{l}{(x+b_i)}=c$ gives $\sum\limits_{i=1}^{l}{a_i}=\sum\limits_{i=1}^{l}{b_i}$, so $l(l-1)+\frac{(l-1)l}{2}=\frac{l(l+1)}{2}$, giving $l=0, 2$, a contradiction.

Finally, $l \leq 2$. I assume you wanted $k \geq 1$, so $l \geq 1$.

If $l=1$, we have $x(x+1)+f(0)^2=f(x)^2$ which clearly fails.

If $l=2$, we have $x(x+1)(x+2)(x+3)+f(0)^2=f(x)^2$. Clearly $f(0)^2$ must be unique, so it must be $1$, and we get your example.

To conclude, $a(a+1)(a+2)(a+3)+1$ is the only example that works. (Unless of course you take $k=0$)


The first part of this post is an incomplete solution, which I first posted. After the break there is what I believe to be a complete solution, based on a crucial result mentioned by @IvanLoh in his answer.

Some $10$ years ago a question was asked in a newsgroup (remember?), whether the polynomial $$ x (x-1) (x-2) \dots (x - (k-1)) + 1 $$ is irreducible in $\mathbf{Z}[x]$ for $n > 4$. Small cases are easily dealt with, in particular for $n = 4$ you get $$ x (x-1) (x-2) (x-3) + 1 = x^4 - 6 x^3 + 11 x^2 - 6 x + 1 = (x^2 - 3x +1)^2. $$ Note that if you change $x$ to $-x$, you find a formula for your statement that $a(a+1)(a+2)(a+3) + 1$ is always the square of an integer.

I gave a proof of irreducibility, which appealed to Pythagorean triples in the end. It is written up in my Algebra notes, on page 76. These notes are in Italian, if needed I can easily translate them.

Anyway, I believe the same argument can be used to prove that for $n > 4$, and any $m > 0$ there is no polynomial $g \in \mathbf{Z}[x]$ such that $$ x (x + 1) \dots (x + k - 1) + m = g(x)^ 2. $$ I must admit that it is not clear to me whether this solves your problem; perhaps it is so for obvious reasons, but I cannot see it.

Anyway, first note that $m$ is a square here, just set $x = 0$. Also, $n$ is even, so substituting $-x$ for $x$ one gets the version I dealt with above, and my proof should work nearly verbatim.

But let us stress again that I wonder whether the following is true. Suppose $f \in \mathbf{Z}[x]$ is such that $f(a)$ is the square of an integer for infinitely many $a \in \mathbf{Z}$. Does it follow that $f$ is the square of a polynomial $g \in \mathbf{Z}[x]$?


Thanks to @IvanLoh for confirming that the fact just mentioned is indeed true. (And actually the paper linked to by @IvanLoh shows that it is enough to assume many values of $f$ are squares.)

I am trying to adapt the proof for the case of the notes mentioned above, but at the moment it does not stand.