# Is there any formula for $\sum_{k=1}^n k!$? [duplicate]

This question already has an answer here:

Do we have any formula for the sum of factorials above?

## marked as duplicate by Omnomnomnom, Namaste algebra-precalculus StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 23 '16 at 14:42

• There's no nice formula, but there is the formula given here using the $Ei$ and $E_n$ functions – Omnomnomnom Aug 23 '16 at 14:34
• You can find more info on this sequence here → oeis.org/A003422 but I guess you will be disappointed (I will post one to grab some points, though, because I'm that shallow). – PseudoNeo Aug 23 '16 at 14:35
• Nice, quick find, @Omnomnomnom ! – Namaste Aug 23 '16 at 14:44

According to its OEIS page, we have $$\sum_{k=0}^{n-1} k! = \int_0^{+\infty} \frac{x^n - 1}{x - 1}\, e^{-x}\, dx.$$
$$\sum_{k=a}^nk!=-(-1)^a\Gamma(a+1)\cdot!(-a-1)-(-1)^n\Gamma(n+2)\cdot!(-n-2)$$
Where $\Gamma(x)$ is the gamma function and $!n$ is the subfactorial function.