I've been trying to get back into some combinatorics, and in my reading, I find that $$ S(n,k)=\sum 1^{a_1-1}2^{a_2-1}\cdots k^{a_k-1} $$ where the sum is taken over all compositions $a_1+\cdots+a_k=n$. Here $S(n,k)$ denotes Stirling numbers of the second kind. I'm trying to understand why there is a combinatorial reason for this equality. So for each partition $\pi$ of $\{1,\dots,n\}$ into $k$ blocks, there should be an associated composition $a_1+\cdots+a_k=n$ such that exactly $1^{a_1-1}2^{a_2-1}\cdots k^{a_k-1}$ partitions are associated with this composition.
I read that by defining $a_1+\cdots+a_i$ to be the least $r$ such that removing $1,2,\dots,r$ from $\pi$ gives a resulting partition has $k-i$ blocks, shows this association.
My question is, why does this method work? The explanation is sparse, so I was hoping to see more detail. Thank you.
A slick generatingfunctionological approach uses a recursion formula. Let
$$f_k(x)=\sum_{n=k}^\infty \left\{n\atop k\right\}x^n.$$
$$=\left\{k\atop k\right\}x^k+\sum_{n=k}^\infty\left\{n+1\atop k\right\} x^{n+1}$$
$$=x^k+x\sum_{n=k}^\infty\left(k\left\{n\atop k\right\}+\left\{n\atop k-1\right\}\right)x^n$$
$$=x^k+x\left(kf_k(x)+f_{k-1}(x)-\left\{k-1\atop k-1\right\}x^{k-1}\right)$$
$$=kxf_k(x)+xf_{k-1}(x).$$
With $f_1(x)=x/(1-x)$ and $f_k(x)=x/(1-kx)\cdot f_{k-1}(x)$ we obtain by induction
$$f_k(x)=\frac{x}{1-kx}\;\cdots\;\frac{x}{1-2x}\frac{x}{1-x}=\prod_{l=1}^k\frac{x}{1-lx}$$
$$\large =\prod_{l=1}^k\left(\sum_{m_l=1}^\infty l^{m_l-1}x^{m_l}\right)=\sum_{n=k}^\infty \left(\sum_{m_1+\cdots+m_k=n}1^{m_1-1}2^{m_2-1}\cdots k^{m_k-1}\right)x^n.$$
Equate coefficients between the two power series and then our work here is done.