# What is $\sum_{n=1}^n(-1)^m\frac{m^{n-m+1}}{(n-m)!}$?

So consider the sum $$S=\sum_{m=1}^n(-1)^m\frac{m^{n-m-1}}{(n-m)!},$$ where $$n$$ is some fixed, positive integer. For specific values of $$n$$, this gives $$-1$$, $$-\frac{1}{2}$$, $$\frac{1}{6}$$, $$\frac{1}{12}$$, $$-\frac{3}{40}$$, $$-\frac{1}{120}$$, $$\frac{31}{1008}$$, $$-\frac{29}{5040}$$, $$-\frac{7}{640}$$, $$\frac{2087}{362880}$$,... for $$n=1, 2, 3, 4, 5, 6, 7, 8, 9, 10,$$ ... Is there a way to evaluate this sum for general $$n$$?

• curious, is there any additional context for this? Apr 18, 2021 at 15:29
• Not especially. It was part of a combinatorial factor that popped out while I was doing some quantum Fermi gas calculations, and I wondered if it had a clean expression. Apr 18, 2021 at 16:02
• It appears $n!S(n)$ is an integer for all $n$. Maybe that integer sequence is in OEIS? Apr 18, 2021 at 17:08
• Thanks! I checked OEIS and it seems that the $S(n)$ are the coefficients of $x^n$ in the Taylor expansion of $-\log(1 + x e^x)$. Apr 18, 2021 at 17:33

$$S_n = \sum_{m=1}^n (-1)^m \frac{m^{n-m-1}}{(n-m)!}$$
$$\sum_{m=0}^{n-1} (-1)^{n-m} \frac{(n-m)^{m-1}}{m!} = \frac{(-1)^n}{n} + \sum_{m=1}^{n-1} (-1)^{n-m} \frac{(n-m)^{m-1}}{m!} \\ = \frac{(-1)^n}{n} + \sum_{m=1}^{n-1} (-1)^{n-m} \frac{1}{m} [z^{m-1}] \exp((n-m)z) \\ = \frac{(-1)^n}{n} + \sum_{m=1}^{n-1} (-1)^{n-m} \frac{1}{n-m} [z^m] \exp((n-m)z) \\ = \frac{(-1)^n}{n} + \sum_{m=1}^{n-1} (-1)^{m} \frac{1}{m} [z^{n-m}] \exp(mz) \\ = \sum_{m=1}^{n} (-1)^{m} \frac{1}{m} [z^{n-m}] \exp(mz) \\ = [z^n] \sum_{m=1}^{n} (-1)^{m} \frac{1}{m} z^m \exp(mz).$$
$$[z^n] \sum_{m\ge 1} (-1)^{m} \frac{1}{m} z^m \exp(mz) = [z^n] \log\frac{1}{1+z\exp(z)}.$$