Exercise 643Number theory › Diophantine equationsM1Added 5 Nov 2026
When is 1! + 2! + … + n! a perfect square?
#squares modulo n#factorials#Diophantine
Statement
Find all positive integers such that is a perfect square.
Hint
For large most of the terms are multiples of . Which residues can a square have modulo ?
Show solutionHide solution
Solution
Small cases. : . : , not a square. : . : , not a square.
Large . For , . So for ,
But squares modulo are only , so is not a square modulo .
Answer. and .
Lesson. To show that an equation has no solutions, find a modulus in which the sum stabilises and the target is not a square (here , where the factorials die out).