<s>[INST] Evaluate weighted stirling number sum - $\sum_{i=0}^n k*c(n,k)$ How to evaluate
$$\sum_{k=0}^n k*c(n,k)$$
Where $c(n,k)=|s(n,k)|$ is the stirling number of the first kind without a sign.
 [/INST] We seek to verify that
$$\sum_{k=0}^n k {n\brack k} = {n+1\brack 2}.$$
This is
$$n! [z^n] \sum_{k=1}^n k
\frac{1}{k!} \left(\log\frac{1}{1-z}\right)^k.$$
Here we can extend to infinity due to the coefficient extractor and the
fact that $\log\frac{1}{1-z} = z +\cdots$:
$$n! [z^n] \log\frac{1}{1-z} \sum_{k\ge 1}
\frac{1}{(k-1)!} \left(\log\frac{1}{1-z}\right)^{k-1}
\\ = n! [z^n] \log\frac{1}{1-z}
\exp\log\frac{1}{1-z}
= n! [z^n] \frac{1}{1-z} \log\frac{1}{1-z}
= n! \times H_n.$$
On the other hand we have
$${n+1\brack 2} = (n+1)! [z^{n+1}] \frac{1}{2}
\left(\log\frac{1}{1-z}\right)^2
\\ = (n+1)! \frac{1}{2}
\sum_{q=1}^n \frac{1}{q} \frac{1}{n+1-q}
\\ = n! \frac{1}{2}
\sum_{q=1}^n \left(\frac{1}{q} + \frac{1}{n+1-q}\right)
= n! \times H_n$$
and we have the claim. We can prove that $\exp\log\frac{1}{1-z} =
\frac{1}{1-z}$ using the combinatorial class $\mathcal{P}$ of
permutations which are sets of cycles:
$$\def\textsc#1{\dosc#1\csod}
\def\dosc#1#2\csod{{\rm #1{\small #2}}}
\mathcal{P} = \textsc{SET}(\textsc{CYC}(\mathcal{Z}))$$
as presented in Analytic Combinatorics by Flajolet amd Sedgewick.
</s>