<s>[INST] 10-permutations with exactly 4 inversions Let $p = p_1p_2\dots p_n$ A pair of elements $(p_i,p_j)$ is called an inversion in p if i > j and $p_i < p_j $.
Now, I know that the generating function for 10-permutations with k inversions is $I_{10}=(1+x)(1+x+x^2)\dots (1+x+\dots +x^9) $ where the coefficient of $x^4$ is the number I'm looking for, however, I do not want to expand this product because I think there must be a cleaner way to do it.
 [/INST] As pointed out by @Jack D'Aurizio, it's not that hard to compute the coefficient of $x^4$ in the generating function.
We have
$$\begin{aligned}I_{10} &= (1+x)(1+x+x^2)(1+x+x^2+x^3) \cdots (1+x+\dots +x^9) \\
&= \frac{1-x^2}{1-x} \cdot \frac{1-x^3}{1-x} \cdot \frac{1-x^4}{1-x} \cdots \frac{1-x^{10}}{1-x} \\
&= (1-x^2)(1-x^3)(1-x^4) \cdots (1-x^{10}) (1-x)^{-9} \\
&= (1-x^2)(1-x^3)(1-x^4) \cdots (1-x^{10}) \sum_{i=0}^{\infty} \binom{9+i-1}{i} x^i \\
\end{aligned}$$
There are only a few ways the exponents in this expression can add up to $4$: $0+4 =2+2=3+1=4+0$.  So
$$[x^4]I_{10} = \binom{9+4-1}{4} - \binom{9+2-1}{2} - \binom{9+1-1}{1} - \binom{9+0-1}{0} = 440$$
</s>