This question already has an answer here:

Is there any compact formula for:

$$\sum_{k=0}^n k!$$

I've tried to find it using one method for summation, but I was able to receive only compact formula for $\sum_k k! \cdot k = (n+1)!-1$

I've typed it into wolfram, but answer is also pretty complicated.


marked as duplicate by J. M. is a poor mathematician, Pedro Tamaroff, Henry T. Horton, vonbrand, Micah Apr 4 '13 at 0:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ I want to find compact formula for $\sum_{k=0}^n (k^2+1)k!$, and I have simplified everything besides part $\sum_k k!$ $\endgroup$ – JosephConrad Apr 3 '13 at 21:23
  • 4
    $\begingroup$ Here's a direction: we have that $(k+1)^2 = k^2 + 2k + 1$, so that $(k+1)^2 k! = (k+1) \cdot (k+1)!$. You know a form for the sum of $k \cdot k!$, so do you see how to get a form for $(k^2 + 1) k!$? $\endgroup$ – A Blumenthal Apr 3 '13 at 21:28
  • 2
    $\begingroup$ $(k+1)^2-2k=k^2+1$. $\endgroup$ – i707107 Apr 3 '13 at 21:34
  • $\begingroup$ OK guys, I've solved this task. Thank you all for your hints! Because questions is connected with $\sum_k k!$ I accepted this answer that refers to that sum. $\endgroup$ – JosephConrad Apr 3 '13 at 21:44

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.

  • 3
    $\begingroup$ I hereby annoit Mhenni as king of the Gamma functions! (+1) $\endgroup$ – Ron Gordon Apr 3 '13 at 21:49
  • 2
    $\begingroup$ @RonGordon: Thanks for the comment. I really appreciate it. On this website, we are really learning from each other. Thanks for everyone who is contributing and working on this website. $\endgroup$ – Mhenni Benghorbal Apr 3 '13 at 22:21

This is A003422; the only more or less closed form expression given there is


  • $\begingroup$ But note also the e.g.f.: $(Ei(1)-Ei(1-x)) e^{x-1}$. That is, $\sum_{i=0}^{n-1} i!$ is $n!$ times the coefficient of $x^n$ in the Taylor series of that function. $\endgroup$ – Robert Israel Apr 3 '13 at 22:32

\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}

  • 1
    $\begingroup$ You forgot to multiply 2 in the third formula. $\endgroup$ – i707107 Apr 3 '13 at 21:56
  • $\begingroup$ I fixed it.. ty. $\endgroup$ – Halil Duru Apr 3 '13 at 21:57
  • 1
    $\begingroup$ Note that this (through whatever OP did to get $\sum k^2 k!$) would give a nice formula for $\sum k!$, to be reported at OEIS (and make this site world famous ;-)... $\endgroup$ – vonbrand Apr 3 '13 at 22:20
  • $\begingroup$ Good point ,OP must have made a mistake there--- otherwise we would have contacted The On-line Encyclopedia of Integer Sequences. $\endgroup$ – Halil Duru Apr 3 '13 at 22:39
  • 1
    $\begingroup$ Yes, that's right I've made a mistake in my calculation. Well, unfortunately, we did not discover a new formula for $\sum k!$ :) $\endgroup$ – JosephConrad Apr 3 '13 at 23:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.