2

I know why 4 out of every 5 of these sequences has a product that ends with 0. It's because they all have one multiple of 5, and at least one multiple of 2, and I understand intuitively that anything multiplied by a multiple of 5 and by a multiple of 2 will give you a product which is a multiple of 10.

But why does every $5th$ product ($6*7*8*9 = 3024$ or $11*12*13*14 = 24024$, etc) end with $24$? Does the fact that a number ends with $24$ tell us something about what its $4$ consecutive factors are, other than the fact that the smallest is $1$ plus a multiple of $5$?

  • 4
    To start try multiplying out $(5n+1)(5n+2)(5n+3)(5n+4)$. Then subtract $24$ and factorise what is left. Then use your imagination – Henry Nov 21 '21 at 02:15
  • 3
    Hint: $\bmod 25!:\ (5n!+!1)(5n!+!4)\equiv \color{#c00}4,\ (5n!+!2)(5n!+!3)\equiv \color{#c00}6,$ and $, 4\cdot 6 = \color{#c00}{24}\ \ $ – Bill Dubuque Nov 21 '21 at 05:03

3 Answers3

1

Any four consecutive numbers that contain a factor of $5$ will have $0$ as the terminal digit, so the consecutive numbers in question must have the form $5k+1,5k+2,5k+3,5k+4$. The product of those numbers is $625k^4+1250k^3+875k^2+250k+24$.

Case 1: $k=2n$. Since every coefficient is divisible by $25$, and $250$ is divisible by $2$, when $k=2n$ is even, all of the terms in $k$ are divisible by $100$.

Case 2: $k=2n+1$. $k=2n+1$ is odd, and every power of an odd number is another odd number, i.e. $(2n+1)^u=2m+1$. Moreover, every every even power of an odd number has the form $4x+1$. So $$k^4=(2n+1)^4=4r+1\\k^3=(2n+1)^3=2s+1\\k^2=(2n+1)^2=4t+1\\k=2n+1$$ Substituting in the original expression, we obtain $$2500r+625+2500s+1250+3500t+875+500n+250+24$$ Here again, all of the variable coefficients are divisible by $100$, leaving $625+1250+875+250+24=3024$ which is $\equiv 24 \bmod 100$.

So whether $k$ is odd or even, the product as a whole is $\equiv 24 \bmod 100$, which manifests as being the last two digits of the product being $24$.

1

This can be proved purely mentally in $< 10$ seconds as follows

$$\begin{align} &\ \ \ \overbrace{(5i\!+\!\color{#0a0}2)(5i\!+\!\color{#0a0}3)}^{\!\!\textstyle\small \equiv \color{#0a0}6\!\pmod{\!25},} \overbrace{(5i\!+\!\color{#c00}1)(5i\!+\!\color{#c00}4)}^{\!\!\textstyle\small \equiv \color{#c00}{4}\!\pmod{\!25}\rlap{, \ {\rm by}\ \ 5\mid \color{#0a0}{2\!+\!3},\color{#c00}{1\!+\!4}}}\,\ \ \ \bmod 100\\[.2em] =\, &\ 4\:\! (5i\!+\!2)(5i\!+\!3)(5i\!+\!1)(5i\!+\!4)/4\, \bmod 25)\\[.2em] =\, &\ 4\:\!(\color{#0a0}6\cdot \color{#c00}4/4\bmod 25)\\[.2em] =\, &\ 4\:\!(\color{#0a0}6)\end{align}\qquad$$

We used $\,4a\bmod 4n\:\! =\:\! 4(a\bmod n)\,$ by MDL = mod Distributive Law, and
also that $\,4\:\!$ divides a sequence of $\:\!4\:\!$ consecutive integers.


Remark $ $ This easily generalizes as below (above is case $\,p=5)$

$$\begin{align} p=2k\!+\!1 \Rightarrow \ &(pi\!+\!1)(pi\!+\!2)\cdots (pi\!+\!p\!-\!1)\\[.2em] =\ &(pi\!+\!\color{#c00}1)(pi\!+\!\color{#c00}{p\!-\!1})\cdots (pi\!+\!\color{#c00}k)(pi\!+\!\color{#c00}{k\!+\!1})\\[.2em] \equiv\ &(\color{#c00}{p-1})!\!\pmod{p^2}\end{align}\qquad\qquad$$

where, as in OP, we group terms to employ this difference of squares generalization
$$\begin{align}\color{#c00}p\mid\color{#0a0}{a\!+\!b}\ \Rightarrow\ &(pi\!+\!a)(pi\!+\!b) = \color{#c00}{p^2}i^2+\color{#c00}p(\color{#0a0}{a\!+\!b})i+ab\equiv ab\pmod{\color{#c00}{p^2}}\\[.3em] \rm{generalizing}\ \ \ &(pi\!+\!a)(pi\!-\!a) = p^2i^2 -a^2\, \equiv\ a(-a)\ \equiv ab\pmod{p^2}\end{align}\qquad\qquad$$

Hence, applying MDL as above we conclude that, for all odd $\,p>0$

$$\bbox[5px,border:1px solid #c00]{(pi\!+\!1)(pi\!+\!2)\cdots (pi\!+\!p\!-\!1)\,\equiv\, (p\!-\!1)!\pmod{(p\!-\!1)p^2}}$$

Bill Dubuque
  • 272,048
  • +1. I did it mod $100$ mentally in about 10 seconds that $[(10x+1)(10x+2)],[(10x+3)(10x+4)]\equiv [30x+2][70x+12]\equiv (140+360)x+24\equiv 24 \mod {100},$ and then $(10y+6)(10y+7)]10y+8)(10y+9)= (10x+4)(10x+3)(10x+2)(10x+1)$ where $x=-y-1$ – DanielWainfleet Nov 21 '21 at 08:34
  • @Dan Yes, that works fine, but it's a little more work that way w/o exploiting the "difference of squares" optimization I used. I added an explanation of that to the Remark in case it was not clear. – Bill Dubuque Nov 21 '21 at 10:46
1

Newton's interpolation formula gives $$ \small (5 n + 1) (5 n + 2) (5 n + 3) (5 n + 4) = 24\binom{n}{0}+3000\binom{n}{1}+18000\binom{n}{2}+30000\binom{n}{3}+15000\binom{n}{4} $$ and so the three final digits are always $024$.

Alternatively, let $f(n)=(5n+1)(5n+2)(5n+3)(5n+4)$. Then $$ f(n+1)-f(n)=500 (5 n^3 + 15 n^2 + 16 n + 6) $$ and the original claim follows by induction.

lhf
  • 216,483