CEMC Banner

Problem of the Week

Problem C

How It Ends

Problem

The product of the positive integers 1 to 4 is \[4\times 3\times 2\times 1 =24\] and can be written in an abbreviated form as \(4!\). We say “4 factorial”. So \(4!=24\).
The product of the positive integers 1 to 16 is \[16\times 15\times 14\times\cdots\times 3\times 2\times 1\] and can be written in an abbreviated form as \(16!\). We say “16 factorial”.
The \(\cdots\) represents the product of all the missing integers between 14 and 3.
In general, the product of the positive integers 1 to \(n\) is \(n!\). Note that \(1!=1\). Determine the tens digit and units (ones) digit of the sum \[1!+2!+3!+ \cdots +2019!+2020!+2021!\]

Solution

At first glance seems like there is a great deal of work to do. However, by examining several factorials, we will discover otherwise.
\[\begin{aligned} 1!&=1\\ 2!&=2\times 1=2\\ 3!&=3\times 2\times 1=6\\ 4!&=4\times 3\times 2\times 1=24\\ 5!&=5\times 4\times 3\times 2\times 1=120\\[-1mm]\end{aligned}\]

Now \[\begin{aligned} 6! & = 6\times(5\times 4\times 3\times 2\times 1)=6\times 5!=6(120)=720,\\ 7! & = 7\times(6\times 5\times 4\times 3\times 2\times 1)=7\times 6!=7(720)=5040,\\ 8! & = 8\times (7\times 6\times 5\times 4\times 3\times 2\times 1)=8\times 7!=8(5040)=40\,320,\\ 9! & =9\times(8\times 7\times 6\times 5\times 4\times 3\times 2\times 1)=9\times 8!=9(40\,320)=362\,880, \text{and}\\ 10! & =10\times(9\times 8\times 7\times 6\times 5\times 4\times 3\times 2\times 1)=10\times 9!=10(362\,880)=3\,628\,800.\\[2mm]\end{aligned}\] An interesting observation surfaces, \(9!=9\times 8!,\ 10!=10\times 9!,\ 11!=11\times 10!, \text{and so on}\).
Furthermore, the last two digits of 10! are 00. Every factorial above 10! will also end with 00 since multiplying an integer that ends with 00 by another integer produces an integer product that ends in 00. So all factorials above 10! will end with 00 and will not change the tens digit or the units digit in the required sum. We can determine the last two digits of the required sum by adding the last two digits of each of the factorials from 1! to 9!.
The sum of the last two digits of 1! to 9! will equal

\[1+2+6+24+20+20+40+20+80=213.\]
Therefore, for the sum \(1!+2!+3!+\cdots +2019!+2020!+2021!\), the tens digit will be 1 and the units (ones) digit will be 3. From what we have done, we do not know the hundreds digit.
For Further Thought: If we had only been interested in the units digit in the required sum, how many factorials would we need to calculate? If we wanted to know the last three digits, how many more factorials would be required?