<s>[INST] Prove that $\sum{a^{2}bc}=\binom{n+3}{6}+\binom{n+2}{6}$ Question
We define $S$ as the set of positive integer triplets $(a,b,c)$ such that $a+b+c=n$. I want to prove that the following expression is correct:
$$
\sum_{S}{a^{2}bc}=\binom{n+3}{6}+\binom{n+2}{6}
$$
My Solution
Left Hand Side
Say that there is a line of $n$ balls. We color the first $a$ balls red, the next $b$ balls green, and the rest blue. We then choose two red balls randomly with replacement, choose one green ball randomly, and choose one blue ball randomly. The number of possibilities is given by $\sum_{S}{a^{2}bc}$
Right Hand Side
If the same red ball is chosen twice;
$$
\begin{align}
x_{1}&\text{ red balls lie on the left of the chosen red ball}\\
x_{2}&\text{ red balls lie on the right of the chosen red ball}\\
x_{3}&\text{ green balls lie on the left of the chosen green ball}\\
x_{4}&\text{ green balls lie on the right of the chosen green ball}\\
x_{5}&\text{ blue balls lie on the left of the chosen blue ball}\\
x_{6}&\text{ blue balls lie on the right of the chosen blue ball}
\end{align}
$$
Since $\sum_{i=1}^{6}{x_{i}=n-3}$, using stars and bars we get $\binom{n+2}{5}$ possibilities.
If different red balls are chosen, the approach is the same but we also need to count the number of red balls between the two chosen red ball and multiply by two because either red ball can be chosen first. This give us $2\binom{n+2}{6}$ possibilities.
Since I counted the same possibilities, then the expressions must be equal:
$$
\begin{align}
\sum_{S}{a^{2}bc}&=2\binom{n+2}{6}+\binom{n+2}{5}\\
\\
&=\binom{n+3}{6}+\binom{n+2}{6}
\end{align}
$$
I’d like to know if my solution is correct and if there is alternative solution or discussion.
 [/INST] Alternative solution: let us consider the following generating functions (power series with $\rho=1$):
$$ A(x)=\sum_{a\geq 1}a^2 x^a,\qquad B(x)=\sum_{b\geq 1} b x^b,\qquad C(x) = \sum_{c\geq 1} c x^c. $$
The sum $\sum a^2 bc$ over the triples of positive integers such that $a+b+c=n$ is exactly the coefficient of $x^n$ in $A(x)B(x)C(x)$. By stars and bars we have (formally, pointwise for any $x\in(-1,1)$ and uniformly over the compact subsets of $(-1,1)$)
$$ B(x)=C(x)=\frac{x}{(1-x)^2},\qquad A(x)=\frac{x(1+x)}{(1-x)^3} $$
so
$$ \sum_{a+b+c=n}a^2 bc = [x^n]\frac{x^3+x^4}{(1-x)^7}=[x^{n-3}]\frac{1}{(1-x)^7}+[x^{n-4}]\frac{1}{(1-x)^7} $$
where, as usual, $[x^n]f(x)$ stands for the coefficient of $x^n$ in the Maclaurin series of $f(x)$. Always by stars and bars we have
$$ \frac{1}{(1-x)^7}=\sum_{n\geq 0}\binom{n+6}{6}x^n $$
so
$$ \sum_{a+b+c=n}a^2 b c = \binom{n+2}{6}+\binom{n+3}{6} $$
as wanted.
</s>