<s>[INST] $\sum k! = 1! +2! +3! + \cdots + n!$ ,is there a generic formula for this? 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.
 [/INST] In addition to the special functions given by J.M., an asymptotic expansion can be computed
$$
\begin{align}
\sum_{k=0}^n k!
&=n!\left(\frac11+\frac1n+\frac1{n(n-1)}+\frac1{n(n-1)(n-2)}+\dots\right)\\
&=n!\left(1+\frac1n+\frac1{n^2}+\frac2{n^3}+\frac5{n^4}+\frac{15}{n^5}+O\left(\frac1{n^6}\right)\right)\\
&=\sqrt{2\pi n}\frac{n^n}{e^n}\left(1+\frac{13}{12n}+\frac{313}{288n^2}+\frac{108041}{51840n^3}+\frac{12857717}{2488320n^4}+O\left(\frac1{n^5}\right)\right)
\end{align}
$$
As with most asymptotic expansions, the series does not converge, and cannot be used to get an exact answer, but it gives a good approximation.
Edit: I forgot to give
$$
\begin{align}
\sum_{k=0}^nk!^2
&=n!^2\left(\frac11+\frac1{n^2}+\frac1{n^2(n-1)^2}+\frac1{n^2(n-1)^2(n-2)^2}+\dots\right)\\
&=n!^2\left(1+\frac1{n^2}+\frac1{n^4}+\frac2{n^5}+\frac4{n^6}+\frac{10}{n^7}+O\left(\frac1{n^8}\right)\right)\\
&=2\pi\frac{n^{2n+1}}{e^{2n}}\left(1+\frac1{6n}+\frac{73}{72n^2}+\frac{1049}{6480n^3}+\frac{157541}{155520n^4}+O\left(\frac1{n^5}\right)\right)
\end{align}
$$
</s>