A factorial puzzle from NRICH
A factorial puzzle I found at NRICH:
Consider numbers of the form $u_n = 1! + 2! + 3! + \dots + n!$. How many such numbers are perfect squares?
Write out a few terms
The first thing I like to do, faced with a problem like this, is to write out a few terms to see if there are any patterns I might exploit.
- $u_1 = 1$, which is square!
- $u_2 = 1+ 2 = 3$
- $u_3 = 3 + 6 = 9$, which is square!
- $u_4 = 9 + 24 = 33$
- $u_5 = 33 + 120 = 153$
But hang on!
All of the factorials from 5! onwards end in zero - so all of the $u_n$s with $n \ge 4$ are going to end in three!
And, since no square number ends in a 3, there cannot be any more squares in this sequence.
The answer is therefore two.
Extension problem
What if the sequence begins with $0!$?