Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$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 ?

share|cite|improve this question
You can also prove it's a square by checking that the square of the gcd(p,p') is p - but like induction that just seems to verify that this is true, doesn't explain why the coincidence happens. – user58512 Feb 17 '13 at 13:28

In the paper, 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$)

share|cite|improve this answer
Thank you for the answers. I thought i had a proof by induction for the case k=4 but it was not a correct proof. Sorry for it. – user55514 Feb 18 '13 at 4:17
Brilliant, thanks! – Andreas Caranti Feb 18 '13 at 6:14
I have now posted the way I finish it off using the result you provided. – Andreas Caranti Feb 18 '13 at 11:36
I do not understand quite well the step where it is said that Product(x+ai)-Product(x+bi) is a constant – user55514 Feb 19 '13 at 13:10
We must have $f(x)+f(0)=\prod_{i=1}^{l}{(x+a_i)}$ and $f(x)-f(0)=\prod_{i=1}^{l}{(x+b_i)}$, where $\{a_i\}$ and $\{b_i\}$ form a partiton of $\{0, 1, \ldots , 2l-1\}$. Thus $\prod_{i=1}^{l}{(x+a_i)}-\prod_{i=1}^{l}{(x+b_i)}=c$ for some constant $c$. – Ivan Loh Feb 19 '13 at 13:52

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.

share|cite|improve this answer
Well, $2x^2+1$ is a square for infinitely many values of $x$, for example, but if one checks to see that the equation $y^2=f(x)$ corresponds to a curve of positive genus, then there are at most finitely many such solutions, via a theorem of Siegel. This is certainly true, for instance, if $f(x)$ is irreducible of degree at least $3$. I believe a classification of $f$ for which the corresponding curve has genus $0$ was carried out by Bilu and Tichy. – Mike Bennett Feb 17 '13 at 19:00
@MikeBennett, thanks a lot, I'll be looking into it. – Andreas Caranti Feb 17 '13 at 19:22
It is true. See the link provided in my answer. – Ivan Loh Feb 18 '13 at 1:43
Andreas, your proof seems correct to me. Just you should not say g(0) is odd "avant la lettre". In my opinion g(0) must be odd because u and v have distint parity and we must have uv = 2^(k/2-1)g(0)^2 so g(0) must be odd. Also i agree k must be a multiple of 4, because half the multiplied terms are negative and a square is always positive. The only small doubt i have is the validity/generality of the choosen x= (k-1)/2, a non integer value for x; to give the full proof. – user55514 Feb 19 '13 at 13:04
Though there is the short posibility of g(0)=2(2k+1)=4k+2 with no solution. – user55514 Feb 19 '13 at 13:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.