TITLE: $\sum k! = 1! +2! +3! + \cdots + n!$ ,is there a generic formula for this?
QUESTION [70 upvotes]: I came across a question where I needed to find the sum of the factorials of the first $n$ numbers. So I was wondering if there is any generic formula for this?
Like there is a generic formula for the series:
$$ 1 + 2 + 3 + 4 + \cdots + n = \frac{n(n+1)}{2} $$
or
$$ 1^{2} + 2^{2} + 3^{2} + 4^{2} + \cdots + n^{2} = \frac{n(n+1)(2n + 1)}{6} $$

Is there is any formula for:
$$ 1! +2! +3! + 4! + \cdots + n! $$
and
$$ {1!}^2 +{2!}^2 +{3!}^2 + \cdots + {n!}^2 $$?

Thanks in advance.
If not, is there any research on making this type of formula?
Because I am interested.

REPLY [8 votes]: For what concerns the first one, yes there is.
$$\sum_{k = 0}^{n} k! = \frac{i\pi}{e} + \frac{\text{Ei}(1)}{e} - \frac{(-1)^n\ \Gamma[n+2]\ \Gamma[-n-1, -1]}{e}$$
Where Ei is the Exponential Integral function, and $\Gamma[x]$ is the Euler Gamma Function whilst $\Gamma[x, n]$ is the upper incomplete Gamma Function.
More on IGF
https://en.wikipedia.org/wiki/Incomplete_gamma_function
More on Ei
https://en.wikipedia.org/wiki/Exponential_integral