# Help proving the product of any four consecutive integers is one less than a perfect square [duplicate]

Apparently this is a true statement, but I cannot figure out how to prove this. I have tried setting

$$(m)(m + 1)(m + 2)(m + 3) = (m + 4)^2 - 1$$

but to no avail. Could someone point me in the right direction?

## marked as duplicate by Ben Millwood, JonMark Perry, Watson, Chill2Macht, Frits VeermanAug 23 '16 at 15:09

• correctly factor $(m)(m+1)(m+2)(m+3) + 1$ – Will Jagy Aug 22 '16 at 20:01
• oh, from my answer yesterday, if you suspect that a polynomial is a square, find the GCD of it with its derivative. math.stackexchange.com/questions/1899346/… – Will Jagy Aug 22 '16 at 20:03
• There is some discussion of this on the corresponding OEIS sequence. oeis.org/A062938 – Peter Kagey Aug 22 '16 at 21:43
• What about computing the $\gcd$ between $f(x)=x(x+1)(x+2)(x+3)+1$ and its derivative? – Jack D'Aurizio Aug 22 '16 at 23:32
• I'm not saying it's an intentional duplicate! Just that you can probably find good answers there instead of getting more ones here – Ben Millwood Aug 23 '16 at 14:31

\begin{align} m(m+1)(m+2)(m+3)&=\left[(m)(m+3) \right] \left[ (m+1)(m+2)\right]\\ &=\left[m^2+3m \right] \left[ m^2+3m+2\right]\\ &=\left[(m^2+3m+1)-1 \right] \left[ (m^2+3m+1)+1\right]\\ &=(m^2+3m+1)^2-1 \end{align}

If you have trouble approaching this, try some examples: Note that (for instance)

$$1 \times \color{red}{2 \times 3} \times 4 = 24 = 5^2-1$$

$$2 \times \color{red}{3 \times 4} \times 5 = 120 = 11^2-1$$

$$3 \times \color{red}{4 \times 5} \times 6 = 360 = 19^2-1$$

and observe that

$$5 = \color{red}{2 \times 3} - 1$$

$$11 = \color{red}{3 \times 4} - 1$$

$$19 = \color{red}{4 \times 5} - 1$$

So try seeing if

$$m\color{red}{(m+1)(m+2)}(m+3) = [\color{red}{(m+1)(m+2)}-1]^2-1$$

• My favourite methods which solves a huge number of problems: Just try it and see what happens... – gnasher729 Aug 22 '16 at 23:39
• @gnasher729: It's in my profile! :-) – Brian Tung Aug 23 '16 at 0:08

You can take the product of the four consecutive integers as $$(m-1)m(m+1)(m+2)$$

Adding $1$ and simplifying, we get $$m^4+2m^3-m^2-2m+1$$ $$=m^4+m^2+1+2m^3-2m^2-2m$$ $$=(m^2+m-1)^2$$

Intro: this is the business about taking the gcd of a polynomial and its derivative, in order to detect a repeated factor. In this case, the repeated factor just squares to give the original, so this is one of the simplest types. For this answer yesterday, How can one find the factorization $a^4 + 2a^3 + 3a^2 + 2a + 1 = (a^2 + a + 1)^2$ from scratch? I deliberately made up a more complicated situation. In that one, it was actually the cube of something.

$$f = m^4 + 6 m^3 + 11 m^2 + 6 m + 1$$ $$f' = 4 m^3 + 18 m^2 + 22 m + 6$$ $$f'/2 = 2 m^3 + 9 m^2 + 11 m + 3$$ $$2 f - m (2 m^3 + 9 m^2 + 11 m + 3) = 3 m^3 + 11 m^2 + 9 m + 2$$ $$3(2 m^3 + 9 m^2 + 11 m + 3) - 2 (3 m^3 + 11 m^2 + 9 m + 2) = 5 m^2 + 15 m + 5.$$ With $$5 m^2 + 15 m + 5 = 5 (m^2 + 3m + 1)$$ we want $$\gcd_{\mathbb Q}(2 m^3 + 9 m^2 + 11 m + 3,m^2 + 3m + 1 ).$$ However,, $$2 m^3 + 9 m^2 + 11 m + 3 = (2m+3)(m^2 + 3m + 1)$$ so the GCD is $m^2 + 3m + 1$ itself. This must be a repeat factor of the original $f,$ and we check that, in fact, $f = (m^2 + 3m+1)^2$

You can solve this without much thinking.

By expanding the product, we find $m(m+1)(m+2)(m+3) = m^4 + 6m^3 + 11m^2 + 6m$. That's a bit bigger than $(m^2)^2 = m^4$. $(m^2+c)^2 = (m^4 + 2m^2c + c^2)$ is still too small because there is no term $m^3$. $(m^2+cm)^2 = m^4 + 2cm^3+c^2m^2$ looks better, especially if we let c = 3.

$(m^2+3m)^2 = m^4 + 6m^3 + 9m^2$ is still just a little bit too small, by about $2m^2$. So we add another c: $(m^2+3m+c)^2 = m^4 + 6m^3 + 2cm^2 + 9m^2 + 6cm + c^2$. We let c = 1 to match the term $11m^2$ and get $(m^2+3m+1)^2 = m^4 + 6m^3 + 11m^2 + 6m + 1$. Exactly 1 more than the product, just what we wanted. So

$m(m+1)(m+2)(m+3) = (m^2+3m+1)^2 - 1$.

That's the answer, without much thought at all.

This has been very adequately answered according to modern methods; however I feel I may add something by explaining it in the plain English prose approach used in older mathematics texts. My statements can be translated into equations if you so wish and will approximate the proofs already given; however by stating it in English we may see the underlying relations at work more clearly (or at least non-mathematicians may so see.)

First consider a perfect square. Not the geometric figure, but the product of a number multiplied by an equal number; for instance, 81 as the product of 9 and 9.

Note that if we "slide these two factors apart," that is, increase one of them while decreasing the other by the same amount, their product will change. 8 x 10 is 80, which is 1 less than the initial product.

Let us slide them apart a little further—by a difference of 2 each from the initial number, 9. We get 7 x 11, which is 77, and this is 4 less than the initial square product of 9 by 9.

Note that 1 x 1 = 1, and 2 x 2 = 4. In fact, there is a general principle here:

If we begin with two equivalent numbers multiplied together, and we decrease one by the same amount as we increase the other, their product will decrease by an amount equal to the square of the difference that we make.

In algebraic terms we can express this like so:

X*X = Y

(X-D)*(X+D) = Y - D^2

This is most easily susceptible to geometric proof; I will essay to draw a picture with words that can be easily visualized:

Consider an actual geometric square of 9 units by 9 units. If a single row of 9 unit squares is removed from the top of the square, and placed along the right hand side so as to form a rectangle 1 unit longer than the initial square was wide, there will be a single unit square left over. 9 unit squares were removed from the top row, but only 8 are needed to extend the width of the figure by adding a 10th column. This is easy to see, certainly.

Similarly it can be seen that regardless of the initial size of the square, if a single row of unit squares is manipulated from the top row so as to form a new additional right hand column, the column will be adequately filled with 1 less unit square than was removed. Thus we see that our general principle given earlier holds true at least for such cases where the two numbers are increased and decreased respectively by an amount equal to 1, whatever the initial equivalent numbers may be.

Now let us consider the more general case where we remove multiple rows from the top of our square, rather than only a single row, and manipulate these to form additional columns equal in number to the number of rows we have removed. In such wise we can visualize that if we remove, let us say, 3 rows from the top of our figure, the columns that remain will each of them be 3 units shorter than they were previously, and each of the 3 new columns which we wish to add shall also need to be 3 units shorter than the original columns, to match the newly shortened columns that remain. But, the rows that we have removed to convert to columns are each of them the same length (width) as the original columns' height, for the initial figure was a perfect square! Thus we will have 3 extra unit squares in each of the 3 rows we have removed, which will none of them be required to form our additional columns. This holds true for any number, not only 3, as can easily be seen.

Having satisfied ourselves that the general statement given above is in fact a general truth, let us concern ourselves with consecutive integers.

At first glance consecutive integers, being exactly 1 unit apart, would not seem to fit in with the rules given above. However, if we consider a perfect square whose sides are each, for instance, 8 1/2 units long, we shall see that an 8 by 9 rectangle can be formed by removing the top half-row from the square and placing it along the right hand side. This gives an extra 1/4 unit square of dimensions 1/2 unit by 1/2 unit.

Similarly, integers which are 3 units apart from each other such as 7 and 10, can be formed as a rectangle from a square by removing and rearranging 1 1/2 rows from a square of non-integer length sides to form a perfect rectangle, after discarding the additional 1 1/2 unit by 1 1/2 unit square which is unnecessary.

Since in each case, whether 1 unit apart or 3 units apart, the rectangle formed is a perfect rectangle of integer length sides, the number of unit squares in each rectangle is of course an integer as well.

The rectangles in this particular case can be formed beginning from the same square, of 8 1/2 unit by 8 1/2 unit dimensions, and in the one case by discarding 1/4 of a unit square and in the other 2 1/4 unit squares. This is of course true whether we formed rectangles of dimensions 7 x 10 and 8 x 9, or 1007 x 1010 and 1008 x 1009. The discarded quantities are the same in each case. Thus we see that in any case patterned after this one, the rectangles would be exactly 2 unit squares different from one another.

If we take all the unit squares from the larger of these two rectangles and form them into a single row, and from the smaller of the two rectangles we form all the unit squares into a single column, we can form the dimensions of a much larger rectangle with a length (width) 2 units greater than its height.

By reversing the manipulation performed earlier, we can remove a single column from the right hand side of this larger rectangle and place it along the top to almost form a square—for it should be seen at this point that we shall be 1 unit square lacking from forming a perfect square. And this shall be true regardless of which numbers we begin our manipulation with, that we shall always end up exactly 1 unit square short of a perfect square.

To state this principle concisely, and without the necessity for geometric visualization, we should say that:

Of four consecutive numbers, if the inner two are multiplied together and the outer two are multiplied together, they shall form products different from each other by exactly 2 units in every case,

and further, that:

Any two numbers which differ from each other by exactly 2 units shall form, when multiplied, a number precisely 1 unit less than the perfect square formed of the number exactly interposing between them,

which will be seen by the astute reader to be merely a special case of the more general principal stated earlier in this passage.

You can make the algebra simpler by starting from a better place than $m(m+1)(m+2)(m+3)$. Think symmetry!

\begin{align} (m - \tfrac 3 2)(m - \tfrac 1 2)(m + \tfrac 1 2)(m + \tfrac 3 2) &= (m^2 - \tfrac 9 4)(m^2 - \tfrac 1 4) \\ &= m^4 - \tfrac 5 2 m^2 + \tfrac{9}{16} \\ &= (m^2 - \tfrac 5 4)^2 - 1 \end{align}

Finally, if $m - \frac 1 2$ is an integer, $m = k + \frac 1 2$ where $k$ is an integer.

Therefore $m^2 - \frac 5 4 = k^2 + k - 1$ is also an integer.

I will show that $16m(m+1)(m+2)(m+3) = 16(m^2 + 3m + 1)^2 - 16$

It will follow that $$m(m+1)(m+2)(m+3) = (m^2 + 3m + 1)^2 - 1$$

Proof: \begin{align} 16 m(m+1)(m+2)(m+3) &=(2m)(2m+2)(2m+4)(2m+6)\\ & ---\text{let $2m = n-3$}---\\ &=(n-3)(n-1)(n+1)(n+3)\\ &=(n-3)(n+3) \cdot (n-1)(n+1) \\ &=(n^2 - 9)(n^2 - 1) \\ &=n^4 - 10n^2 + 9 \\ &=(n^2 - 5)^2 - 16 \\ & ---\text{Note $n = 2m+3$}---\\ &=(4m^2 + 12m + 4)^2 - 16\\ &=16(m^2 + 3m + 1)^2 - 16\\ \end{align}