How many non-negative integer solution is there for the equation $ x_1 + x_2 + x_3 + x_4 + 8*x_5 = 20 $? I am trying to figure out this problem and the way I think I might need to solve this is to account for the first 4 $x_i$ terms and then add on the possibilities for the $8x_5$ but I am not 100% sure that this is what I need to do. Any suggestions would be appreciated.
 A: Hint: Consider three cases: $x_5=0$, $x_5=1$ and $x_5=2$.
If $x_5=0$, then you want the number of nonnegative integer solutions for
$$
x_1+x_2+x_3+x_4=20
$$
which is the number of ways to align $3$ bars and $20$ stars. For example, the alignment
$$
||\star\star\star|\star\star\star\star\star\star\star\star\star\star\star\star\star\star\star\star\star
$$
represents the solution $x_1=0$, $x_2=0$, $x_3=3$ and $x_4=17$. The number of such alignments is $\binom{23}{3}$ (just choose where you place the $3$ bars).
Count similarly the number of solutions for $x_5=1$ and $x_5=2$ and add up the three numbers you get.
A: Partitioning for $x_5$ $$x_1 + x_2 + x_3 + x_4 + 8*x_5 = 20\\ \to 
8x_5 \leq 20 \to x_5\leq\frac{20}{8} \to x_5=0,1,2\\
\begin{cases}x_5=0 \to x_1 + x_2 + x_3 + x_4 + 8*0= 20\\\\x_5=1 \to x_1 + x_2 + x_3 + x_4 + 8*1= 20\\\\x_5=2 \to x_1 + x_2 + x_3 + x_4 + 8*2= 20\end{cases}\\$$
WE know non-negative integer solution is there for the equation $x_1+x_2+..=+x_k=n$ is $\color{red}{\left(\begin{array}{c}n+k-1\\ k-1\end{array}\right)
}$ so 
$$ 
\begin{cases}x_5=0 \to x_1 + x_2 + x_3 + x_4 = 20&\left(\begin{array}{c}20+4-1\\ 4-1\end{array}\right)
\\\\x_5=1 \to x_1 + x_2 + x_3 + x_4 = 12&\left(\begin{array}{c}12+4-1\\ 4-1\end{array}\right)
\\\\x_5=2 \to x_1 + x_2 + x_3 + x_4 = 4 &\left(\begin{array}{c}4+4-1\\ 4-1\end{array}\right)
\end{cases}$$ 
final answer is :$$\left(\begin{array}{c}20+4-1\\ 4-1\end{array}\right)+\left(\begin{array}{c}12+4-1\\ 4-1\end{array}\right)+\left(\begin{array}{c}4+4-1\\ 4-1\end{array}\right)=\\\left(\begin{array}{c}21\\ 3\end{array}\right)+\left(\begin{array}{c}15\\ 3\end{array}\right)+\left(\begin{array}{c}7\\ 3\end{array}\right)$$
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
With $\ds{\verts{z} < 1}$, the answer is given by
\begin{align}
\bracks{z^{20}}\pars{\sum_{x = 0}^{\infty}z^{x}}^{4}\sum_{y = 0}^{\infty}z^{8y} & =
\bracks{z^{20}}{1 \over \pars{1 - z}^{4}}\,{1 \over 1 - z^{8}} =
\bracks{z^{20}}\sum_{i = 0}^{\infty}{-4 \choose i}\pars{-z}^{\,i}
\sum_{j = 0}^{\infty}\pars{z^{8}}^{\,j}
\\[5mm] & =
\bracks{z^{20}}\sum_{i = 0}^{\infty}\sum_{j = 0}^{\infty}{i + 3 \choose 3}
\sum_{k = 0}^{\infty}\delta_{k,i + 8j}\,z^{k}
\\[5mm] &=
\bracks{z^{20}}\sum_{k = 0}^{\infty}\bracks{{1 \over 6}\sum_{j = 0}^{\infty}
\sum_{i = 0}^{\infty}\pars{i + 3}\pars{i + 2}\pars{i + 1}\delta_{i,k - 8j}}z^{k} \\[5mm] & =
{1 \over 6}\sum_{j = 0}^{\infty}
\sum_{i = 0}^{\infty}\pars{i + 3}\pars{i + 2}\pars{i + 1}\delta_{i,20 - 8j}
\\[5mm] & =
{1 \over 6}\sum_{j = 0}^{\infty}
\pars{23 - 8j}\pars{22 - 8j}\pars{21 - 8j}\bracks{20 - 8j \geq 0}
\\[5mm] & =
{1 \over 6}\sum_{j = 0}^{2}
\pars{23 - 8j}\pars{22 - 8j}\pars{21 - 8j} =
\bbx{\ds{2261}}
\end{align}
