# Prove that the product of four consecutive positive integers plus one is a perfect square

I need to prove the following, but I am not able to do it. This is not homework, nor something related to research, but rather something that came up in preparation for an exam.

If $n = 1 + m$, where $m$ is the product of four consecutive positive integers, prove that $n$ is a perfect square.

Now since $m = p(p+1)(p+2)(p+3)$;

$p = 0, n = 1$ - Perfect Square

$p = 1, n = 25$ - Perfect Square

$p = 2, n = 121$ - Perfect Square

Is there any way to prove the above without induction? My approach was to expand $m = p(p+1)(p+2)(p+3)$ into a 4th degree equation, and then try proving that $n = m + 1$ is a perfect square, but I wasn't able to do it. Any idea if it is possible?

• I assume you posted this from your smartphone in the bathroom during your exam ;) Jun 7, 2012 at 13:57
• @KartikAnand I was just joking, hence the ;) Jun 7, 2012 at 14:16
• @Wipqozn no worries ;) (I knew :P ) Jun 8, 2012 at 11:13
• haha, you had me worried there with your comment :P Jun 8, 2012 at 11:16
• In one sentence:  Consider $p(p+3)=p^2+3p:=n$ and $(p+1)(p+2)=p^2+3p+2=n+2$ so that the product plus one is $n^2 + 2n + 1 = (n+1)^2 = (p^2 + 3p + 1)^2$. Jun 29, 2018 at 18:35

Your technique should have worked, but if you don't know which expansions to do first you can get yourself in a tangle of algebra and make silly mistakes that bring the whole thing crashing down.

The way I reasoned was, well, I have four numbers multiplied together, and I want it to be two numbers of the same size multiplied together. So I'll try multiplying the big one with the small one, and the two middle ones.

$$p(p+1)(p+2)(p+3) + 1 = (p^2 + 3p)(p^2 + 3p + 2) + 1$$

Now those terms are nearly the same. How can we force them together? I'm going to use the basic but sometimes-overlooked fact that $xy = (x+1)y - y$, and likewise $x(y + 1) = xy + x$.

\begin{align*} (p^2 + 3p)(p^2 + 3p + 2) + 1 &= (p^2 + 3p + 1)(p^2 + 3p + 2) - (p^2 + 3p + 2) + 1 \\ &= (p^2 + 3p + 1)(p^2 + 3p + 1) + (p^2 + 3p + 1) - (p^2 + 3p + 2) + 1 \\ &= (p^2 + 3p + 1)^2 \end{align*} Tada.

• Wow you did it, but tell me one thing.You said "I have four numbers multiplied together, and I want it to be two numbers of the same size multiplied together. ", but why? I mean 1 is still being added to expression. Jun 7, 2012 at 9:50
• Well, I was kind of ignoring the 1 for the time being; I wanted two numbers roughly the same, and I thought the details likely to work themselves out :) Jun 7, 2012 at 9:56
• Slightly smoother: When you are at $(p^2+3p)(p^2+3p+2)+1$, let $x=p^2+p+1$, We are looking at $(x-1)(x+1)+1=x^2-1+1=x^2$. Jun 7, 2012 at 10:14
• @AndréNicolas make it 3p in the expression for x Jun 7, 2012 at 10:19
• This goes by what I like to call the 'Mathematics of wishful thinking' : there is a solution, we sort of know what it should look like, and so we go and hope that everything works out. +1 Jun 7, 2012 at 19:29

$(n-1)(n+1)+1 = n^{2}$.

Note that $(n+1)-(n-1)=2$.

With this in mind

\begin{align*} p(p+1)(p+2)(p+3)+1 &= (p^{2}+3p)(p^{2}+3p+2)+1 \\ &= [(p^{2}+3p+1)-1][(p^{2}+3p+1)+1]+1 \\ &= (p^{2}+3p+1)^2 \end{align*}

• Some simple observations oft lead to marvelous discoveries, greatly confirmed here. Jun 7, 2012 at 14:23
• That's beautiful! Jun 7, 2012 at 18:39

Here's another way which begins by exploiting a symmetry in the expression.

Notice that if you substitute $x=p+\frac{3}{2}$, the expression becomes

$$\left(x-\frac{3}{2}\right)\left(x-\frac{1}{2}\right)\left(x+\frac{1}{2}\right)\left(x+\frac{3}{2}\right) + 1$$

Now see that the terms make the product of 2 differences of squares

\begin{align} & \quad \left(x+\frac{3}{2}\right)\left(x-\frac{3}{2}\right)\left(x+\frac{1}{2}\right)\left(x-\frac{1}{2}\right) + 1 \\&= \left(x^2-\frac{9}{4}\right)\left(x^2-\frac{1}{4}\right) + 1 \\ &= \left(x^4 - \frac{10}{4} x^2 + \frac{9}{16}\right) + 1 \\ &= x^4 - \frac{10}{4} x^2 + \frac{25}{16} \\ &= \left(x^2 - \frac{5}{4}\right)^2 \\ &= \left(p^2 + 3p + 1\right)^2 \end{align}

which is a perfect square.

• You miss one final step; to see that it is a perfect square of an integer, you need that $x^2 - 5/4$ is an integer. In this case you could say you are "lucky" that $2 \cdot (3/2), (3/2)^2 - 5/4 \in \mathbb{N}$.
– TMM
Jun 7, 2012 at 19:31
• @TMM: Or you could just say that it's an integer which is the perfect square of a rational number, which makes it the perfect square of an integer. Jun 7, 2012 at 23:05
• Yes, I did miss the final step, but there's no luck involved - it's straightforward algebra that x^2 - 5/4 is an integer. See my edit which completes the proof.
– JTB
Jun 8, 2012 at 13:02

Below I present a generalization.  Using the abbreviations$\rm\ \ c = a\!+\!b,\ \ \color{red}d = ab/2\:\$ we compute

$$\rm\begin{eqnarray} &&\rm\qquad\quad\ \color{blue}{(x\!+\!a)\,(x\!+\!b)}\,(x\!+\!c)\,x &=&\rm\, \color{blue}{(x^2\!+cx\ \ +\ \ ab\ \ \ \, )}\,(x^2+cx\:\!) \\ && &=&\rm\, (x^2\!+cx+d\ \,\color{red}{+\, d})\,(x^2+cx+d\, \color{red}{-\,d}) \\ && &=&\rm\, (x^2\!+cx+d)^2\! \color{red}{- d^2} \\ \rm b=2\quad &\Rightarrow&\rm\quad\ \ \ \ x(x+a)(x\!+\!2)(x\!+\!a\!+\!2) &=&\,\rm (x^2\!+(a\!+\!2)\,x+a)^2 -a^2 \\ \rm a=1\quad &\Rightarrow&\rm\qquad\quad\ \ \ x(x\!+\!1)(x\!+\!2)(x\!+\!3) &=&\rm\, (x^2\!+3\:\!x+1)^2 -1\ \ \ as\ sought. \end{eqnarray}$$

Set $p+1.5=q$. Now \begin{align*}m &= (q-1.5)(q-0.5)(q+0.5)(q+1.5)+1 \\ &= (q-1.5)(q+1.5)(q-0.5)(q+0.5)+1 \\ &= (q^2 - 2.25)(q^2-0.25)+1 \\ \end{align*}

Let $q^2 = r$.

\begin{align*} m &= (r-2.25)(r-0.25)+1\\ &= r^2-2.5a+1.5625 \\ &= (r-1.25)^2. \end{align*}

This is a perfect square since r ends in 0.25 as q ends in 0.5

Basically the substitution converted it from a fourth degree to a quadratic which made it easy to deal with.

• I like this method. The first thing you do is try to make the equation at the top more symmetrical, which was basically my idea, but we went about it in different ways. Jun 7, 2012 at 10:10
• @benmachine totally agree, but I just don't that like the number 1.5 Jun 8, 2012 at 2:18

$$1+p(p+1)(p+2)(p+3)=1+ \dots +p^4.$$

If you want a general formula, it must be a square either of the form $(p^2+cp+1)^2$ or $(p^2+cp-1)^2$ for some constant $c$.

Expand the squares and the original product and match up two terms to calculate $c$. Verify that the other coefficients are correct as well.

Details:

The expansion of the product is $p^4+6p^3+11p^2+6p+1$.

The expansions of the squares are $p^4 + 2cp^3+c^2p^2\pm2p^2\pm2cp+1$.

Comparing the coefficients of $p^3$ gives $c=3$ which evidently works with the plus sign, so we get $(p^2+3p+1)^2$.

If I am missing something I will take this answer down, but the following seems responsive to your question.

If

$m = 1 + x(x+1)(x+2)(x+3)$ we can expand this as $1+6x+11x^2+6x^3+x^4$.

This is

$m = (1+3x+x^2)^2$

So when x is an integer, this shows that m is a perfect square, without induction.

• How did you factorise the quartic? Jun 7, 2012 at 9:47
• @benmachine: I basically used Phira's process (below) and guessed the constant. Jun 7, 2012 at 9:51
• @benmachine you can also do $(x^2+ax+b)^2 = 1+6x+11x^2+6x^3+x^4$ and that is easy to solve for $a$ and $b$. Jun 7, 2012 at 13:26

I think there are two issues here. One is constructing the quartic, which just depends on you doing the algebra correctly. The second is proceeding to factorise the quartic. It would be easier to factorise it if you know what the factorisation is going to be.

To discover this, I tried a few examples. For $p=7$, the quartic gives $5041=71^2$. For $p=14$, the quartic gives $57121=239^2$. I noticed that $71=72-1=8\times9-1$ and $239=15\times16-1$.

This suggested that the quartic was $((p+1)(p+2)-1)^2$.

Once you know the answer, it is easy to find it!

Take $p^2$ common after multiplying.
Then put $p +1/p =y$ and solve.

You will get the answer.

I have to add what I think is a 'dumb' way to do it by hand (with paper) as opposed to Alex B. succinct cleverness:

First, multiply out the product to get $p^4 + 6p^3 + 11p^2 + 6p + 1$.

Since this is a square, it must be a quadratic $p^2 + x p + y$.

Squaring the quadratic, ignoring a lot of the cruft, and just looking at just the second and last coefficients

$$6 = x + x$$

and

$$1 = y^2$$

and you're done.

Select any $$a\in\mathbb{Z}_{\ge 2}$$ and define $$P$$ to be the product of the four consecutive integers $$a-1,a,a+1$$ and $$a+2$$, that is $$P=(a-1)a(a+1)(a+2).$$ Expanding $$P$$, we get $$P=a^4+2a^3-a^2-2a.$$ Thus, we have $$P+1=a^4+2a^3-a^2-2a+1=(a^2+a-1)^2,$$ that is $$P+1$$ is a perfect square. Now since $$a\in\mathbb{Z}_{\ge 2}$$ is arbitrary, implies that $$P+1$$ is a perfect square for all $$a\in\mathbb{Z}_{\ge 2}$$. This completes the proof.

Expanding $p(p+1)(p+2)(p+3)+1$ we get

$$p^4+6p^3+11p^2+6p+1$$

Note that $p^4$ is $(p^2)^2$, so this is equal to a square plus something extra. If this is to be a square number, then the extra must be a sum of odd numbers starting with $2p^2+1$, that is, we must have

$$6p^3+11p^2+6p+1=\sum^n_{k=0}(2(p^2+k)+1)$$

for some $n$. That sum can be computed to be

$$(n+1)(2p^2+1)+(n+1)n$$

and now it's quite easy to see that there's only one possible choice for $n$. Indeed, we want this to be a cubic in $p$, so $n$ must be linear in $p$. The coefficient of the linear term must be $3$, so that we get a cubic term of $6p^3$ after multiplying out. And since we want a constant term of $1$, we see that there can be no constant term in $n$. So $n=3p$ is the only possible choice. Plugging this in, we find that it works.

Group the factors like this:

$$p(p+3) \times (p+1)(p+2) + 1$$

You should then expand to get $$(x^2+3x)(x^2+3x+2) + 1$$, which can be rewritten as $$(x^2+3x+1-1)(x^2+3x+1+1) + 1$$

This looks familiar, as the factors on the lefthand side is a difference of squares: $$(x^2+3x+1)^2 - 1 + 1$$

Cancel out the minus one and plus one and you have $$(x^2+3x+1)^2$$, which is a perfect square.

• How is your answer different from this one? Nov 26, 2021 at 19:18

To solve this we can use the following theorem:-
Theorem:- For any arbitrary integer a, the following holds true:- $$2|a(a+1)$$.
Proof:- We know that a can either can be of the from $$2q$$ or $$2q+1$$. Therefore:-
i) If a = $$2q$$, then $$a(a+1) = 2q(2q+1)$$, which is divisible by 2.
ii) If a = $$2q+1$$, then $$a(a+1) = (2q+1)(2q+2) = 2(q+1)(2q+1)$$, which is divisible by 2.

Coming to our question we see that $$a(a+1)(a+2)(a+3)+1$$ is equivalent to $$(2q)(2q')+1$$ where $$2q = a(a+1)$$ and $$2q'=(a+2)(a+3)$$. Thus our expression turns out to be $$4x+1$$ where $$x=qq'$$. But we know that a odd perfect square is always of the form $$4k+1$$. Thus is it proved that $$a(a+1)(a+2)(a+3)+1 = d^2$$ for any integer d.

Recursion on the square root, k(n)

n = lead integer

k(n) = square root [n(n+1)(n+2)(n+3) + 1]

k(1)^2 = 25

k(2)^2 = 121

k(3)^2 = 361

k(4)^2 = 841

k(5)^2 = 1681

k(1) = 5

k(2) = 11 = 5+ 6 = 5 + 2*(2+1)

k(3) = 19 = 11+ 8 = 11 + 2*(3+1) = 5 + 2 * ((2+1) + (3+1))

k(4) = 29 = 19+10 = 19 + 2*(4+1) = 5 + 2 * ((2+1) + (3+1) + (4+1))

k(5) = 41 = 29+12 = 29 + 2*(5+1) = 5 + 2 * ((2+1) + (3+1) + (4+1) + (5+1))

k(n) = 5 + 2 * ( (n+1)(n+2)/2 - (1+2) )

 = (n+1)(n+2) - 1


induction step

k(n+1) = k(n) + 2(n+2)

   = (n+1)(n+2) - 1   + 2(n+2)

= (n+2)(n+3) - 1


k(n)^2 - 1 = ((n+1)(n+2))- 1)^2 - 1

        = ((n+1)(n+2))^2 - 2(n+1)(n+2)

= ((n+1)(n+2)) * ((n+1)(n+2) - 2)

= ((n+1)(n+2)) * (n^2 + 3n)

= n(n+1)(n+2)(n+3)


!!!

Thinking a little more about k(n).

A rough approximation of the root of ( n(n+1)(n+2)(n+3) + 1 ) would be n^2.

We might improve it a bit by averaging the products of the outer and inner pair of factors,

k(n) = (n(n+3) + (n+1)(n+2)) / 2

   = (n+1)(n+2) -1


Dead on. Surprising, no?