TITLE: Identity with number of surjective functions
QUESTION [5 upvotes]: Let $S(n,k)$ denote the number of surjective functions from $\{1,2\cdots,n\}$ onto $\{1,2,\cdots,k\}$. I  have verified for $n = 2, 4, 6, 8, 10$ that
$$-(1/2)S(n,1) + (1/4)S(n,2) - (1/8)S(n,3) + \cdots + (-1/2)^n S(n,n) = 0$$
Is this true for all positive even n? Is it a known identity? Any nice proof?

REPLY [4 votes]: Following @joriki we try to evaluate (formal power series)
$$\sum_{q=1}^n (-1/2)^q q! {n\brace q}
= n! [z^n] \sum_{q=1}^n (-1/2)^q (\exp(z)-1)^q.$$
With $n\ge 1$ we can include $q=0$ with no change. Also since
$\exp(z)-1 = z + \cdots$ we can also include $q\gt n$ for no extra
contribution. We get
$$n! [z^n] \frac{1}{1+(\exp(z)-1)/2}
= n! [z^n] \frac{2}{1+\exp(z)}.$$
Now
$$[z^{2n}] \frac{2}{1+\exp(z)}
= \frac{1}{2} [z^{2n}] \frac{2}{1+\exp(z)}
+ \frac{1}{2} [z^{2n}] \frac{2}{1+\exp(-z)}
\\ = [z^{2n}] \frac{1+\exp(-z)+1+\exp(z)}{1+\exp(z)+\exp(-z)+1}
= [z^{2n}] 1 = 0.$$