Compact formula for $\sum_k k!$
You may prefer to deal with the following integral representation
$$ \sum_{k=0}^{n}k! = \sum_{k=0}^{n} \Gamma(k+1)= \sum_{k=0}^{n}\int_{0}^{\infty}x^{k}e^{-x}dx = \int_{0}^{\infty}\frac{x^{n+1}-1}{x-1}e^{-x}dx , $$
where $\Gamma(s)$ is the gamma function.
This is A003422; the only more or less closed form expression given there is
$$\sum_{k=0}^{n-1}k!=\int_0^\infty\frac{x^n-1}{x-1}e^{-x}dx\;.$$
\begin{align} \sum_{k=0}^n (k^2+1)k! &= \sum_{k=0}^n [(k+1)^2-2k]k! \\ &= \sum_{k=0}^n (k+1)(k+1)! -\sum_{k=0}^n 2k \cdot k! \\ &= \bigl((n+2)!+1\bigr) -2 \bigl((n+1)!+1\bigr) \\ &= n(n+1)! -1 \end{align}