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.
 A: There are not so many ways to write $4$ as a sum of positive natural numbers (just $1+1+1+1,2+1+1,2+2,3+1,4$), so to compute the coefficient of $x^4$ in
$$(1+x)(1+x+x^2)\cdot\ldots\cdot(1+x+x^2+\ldots+x^9)$$
is far from being a nightmare. According to this insightful paper, the answer you are looking for is $\color{red}{\large 440}$.
It can be checked with the Mathematica command
$$\text{SeriesCoefficient}\left[\prod _{k=1}^9 \sum _{j=0}^k x^j,\{x,0,4\}\right]$$
and matches with
$$\underbrace{\binom{9}{4}}_{1+1+1+1}+\underbrace{8\cdot\binom{8}{2}}_{2+1+1}+\underbrace{\binom{8}{2}}_{2+2}+\underbrace{7\cdot 8}_{3+1}+\underbrace{6}_{4}.$$
A: 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$$
