I'm trying to follow an example problem of calculating how many $k$-part compositions of $n$ are there, with the restriction that each part is at most 5.
During the calculation there is this mess:
$$\begin{eqnarray*} [x^{n}]x^{k}(1-x^{5})^{k}(1-x)^{-k} & = & [x^{n-k}]\sum_{i\geq0}{k \choose i}\left(-x^{5}\right)^{i}\sum_{j\geq0}{k+j-1 \choose j}x^{j}\\ & = & [x^{n-k}]\sum_{i\geq0}\sum_{j\geq0}{k \choose i}(-1)^{i}{k+j-1 \choose j}x^{5i+j}\\ & = & \sum_{i\geq0,5i+j=n-k}\sum_{j\geq0}{k \choose i}(-1)^{i}{k+j-1 \choose j}\\ & = & \sum_{i=0}^{\left\lfloor \frac{n-k}{5}\right\rfloor }{k \choose i}(-1)^{i}{k+n-k-5i-1 \choose n-k-5i} \end{eqnarray*}$$
I don't exactly understand how the second $\sum$ was gotten rid of. How would one mathematically work with having two conditions under a sum sign, as in the next-to-last line? Where did the floor come from?
First note that $k$ is fixed throughout. The original summation is over all $i,j\ge 0$. However, we want the coefficient of $x^{n-k}$, which is $5i+j$, so the only combinations of $i$ and $j$ that interest us are those satisfying $5i+j=n-k$. This completely determines $j$ as a function of $i$ and vice versa. In particular, given $i$, $j=n-k-5i$. Thus the inner summation $\sum_{j\ge 0}$ in the penultimate line of the computation is feather-bedding: it serves no purpose whatsoever, since the outer summation already determines the unique $j$ that goes with each possible $i$, and the double summation is exactly equivalent to
$$\sum_{i\ge 0,5i+j-n-k}\binom{k}i(-1)^i\binom{k+j-1}j\;.$$
Now substitute $j=n-k-5i$ to get
$$\sum_{i\ge 0}\binom{k}i(-1)^i\binom{n-5i-1}{n-k-5i}$$
and realize that $\binom{k}i=0$ if $i>k$, so that $i$ really just runs from $0$ through $\left\lfloor\frac{n-k}5\right\rfloor$.