Transpositions $(i_1,j_1), \dots, (i_{n-1},j_{n-1})$ form a system of generators of the permutation group $S_n$ iff the graph with the vertices $1, \dots, n$ and the edges $(i_1,j_1)$ etc. is a tree. The length of a permutation $\sigma \in S_n$ w.r.t. this tree is the minimum number of generators to multiply so as to obtain $\sigma$. E.g. for the "linear" tree $(12), (23), \dots, (n-1,n)$ the length of $\sigma$ is the number of inversions $\#\{i < k: \sigma(i) > \sigma(k)\}$. If $K_m$ is the number of permutations of length $m$ then $$\sum_m K_m t^m = (1+t)(1+t+t^2) \dots (1+t+\dots+t^n)$$.
Are there analogs of the formula above for an arbitraty tree? Or at least for some trees, say, for the "bush" $(12), (13), \dots, (1n)$? Expermients show that the formula depends heavily on the tree and generally is not a product...