Find the sum of all the perfect squares that can be expressed as form $\displaystyle \left(\sum_{i=1}^m i! \right)+2016$ .

If you think that no perfect square satisfies this condition, or there are infinitely many perfect squares that satisfy this condition, submit your answer as 999.

**
Notation
**
:
$!$
denotes the
factorial
notation. For example,
$8! = 1\times2\times3\times\cdots\times8$
.

The answer is 2025.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Suppose that $\left(\displaystyle\sum_{i=1}^m i!\right) +2016=n^2$ with $n$ is a positive integer.

If $m\le 5$ it is easy to check that $m=3$ is the unique solution. In that case, we have: $1!+2!+3!+2016=2025=45^2$

If $m\ge6$ , we have $\left(\displaystyle\sum_{i=1}^m i!\right) +2016\equiv 5\ (\bmod{7})$ , cannot be a perfect square.