Summation over $a+b+c=5$ Let $a,b,c$ be positive integers. Compute
$$\sum_{a+b+c=5} (6-a)(6-b)(6-c).$$

The first thing I notice is symmetry, so that I can permute $3!=6$ ways, but i'm not really sure how that works with the condition $a+b+c=10.$ The other method is to fix $a$, but that is reall time-consuming and unfeasible if say $a+b+c=20.$ Is there a clever method to evaluate this sum?
I would like to have a generalized method, please.
 A: By using generating functions, we show that for any non-negative integer $n$,
$$\begin{align}\sum_{a+b+c=n} (6-a)(6-b)(6-c)
&=[x^n]\left(\sum_{k=1}^{\infty}(6-k)x^k\right)^3\\
&=[x^n]\frac{(x(5-6x))^3}{(1-x)^6}\\
&=[x^n]\frac{125x^3-450x^4+540x^5-216x^6}{(1-x)^6}\\
&=125\binom{n+2}{5}-450\binom{n+1}{5}+540\binom{n}{5}-216\binom{n-1}{5}\\
&=-\frac{(n-2)(n-1)(n^3-87n^2+2072n-12960)}{120}.
\end{align}$$
Therefore for $n=5,10,20$ we obtain $465$, $-36$, $-4788$ respectively.
A: $$
\begin{array}{l}
 a + b + c = 5\quad \left| {\,1 \le a,b,c\left( { \le 3} \right)} \right.\quad  \Rightarrow  \\ 
  \Rightarrow \quad \left( {6 - a} \right) + \left( {6 - b} \right) + \left( {6 - c} \right)
 = x + y + z = 13\quad \left| {\,3 \le x,y,z, \le 5} \right.\quad  \Rightarrow  \\ 
  \Rightarrow \quad \left( {x,y,z} \right) \in S = \left\{ {\left( {3,5,5} \right) \vee \left( {4,4,5} \right)
 \vee permut.} \right\}\quad  \Rightarrow \quad  \\ 
  \Rightarrow \quad \sum\limits_{\left\{ {\begin{array}{*{20}c}
   {\,1 \le a,b,c\left( { \le 3} \right)}  \\
   {a + b + c = 5}  \\
\end{array}} \right.} {\left( {6 - a} \right)\left( {6 - b} \right)\left( {6 - c} \right)}  =  \\ 
  = \sum\limits_{\left( {x,y,z} \right) \in S} {xyz}  = 3\left( {3 \cdot 5 \cdot 5} \right)
 + 3\left( {4 \cdot 4 \cdot 5} \right) = 225 + 240 = 465 \\ 
 \end{array}
$$
A: This problem is somewhat specific and nice, since when using symmetry it reduces to the summation of two terms.

We obtain
\begin{align*}
&\color{blue}{\sum_{\substack{a+b+c=5\\a,b,c\geq 1}}(6-a)(6-b)(6-c)}\\
&\qquad=6\sum_{\substack{a+b+c=5\\1\leq a<b<c\leq 3}}(6-a)(6-b)(6-b)\tag{1}\\
&\qquad\quad +3\sum_{\substack{a+b+c=5\\1\leq a=b<c\leq 3}}(6-a)^2(6-c)\tag{2}\\
&\qquad\quad +3\sum_{\substack{a+b+c=5\\1\leq a<b=c\leq 3}}(6-a)(6-c)^2\tag{3}\\
&\qquad\quad +\sum_{\substack{a+b+c=5\\1\leq a=b=c\leq 3}}(6-a)^3\tag{4}\\
&\qquad=0+3\cdot5^2\cdot3+3\cdot5\cdot4^2+0\tag{5}\\
&\qquad=9\cdot25+15\cdot16\tag{6}\\
&\,\,\color{blue}{\qquad=465}
\end{align*}

Comment:

*

*In (1) we observe that the conditions $a+b+c=5$ and $a,b,c\geq 1$ imply that each element $a,b,c$ is less or equal $3$.
We sum up all triples $(a,b,c)$ whereby each two elements are pairwise different. This can be done in $3!=6$ ways. After appropriately renaming the variables we can consider therefore $6$ ordered triples $(a,b,c)$ with $1\leq a<b<c\leq 3$.


*In (2) we sum up all triples $(a,b,c)$ whereby $a$ is equal to $b$ and different to $c$. This can be done in $\frac{3!}{2!1!}=3$ different ways.


*In (3) we have a similiar situation as in (2). Here we consider the constellation $a<b=c$ which can be done again in $\frac{3!}{2!1!}=3$ different ways.


*In (4) we cover the final case $a=b=c$ which can be done in $\frac{3!}{3!}=1$ different way.


*In (5) we observe

*

*there is no admissible triple $(a,b,c)$ with $1\leq a<b<c\leq 3$ and $a+b+c=5$.


*there is just one admissible triple with $1\leq a=b<c\leq 3$ and $a+b+c=5$, namely $\color{blue}{(a,b,c)=(1,1,3)}$.


*there is just one admissible triple with $1\leq a<b\leq c\leq 3$ and $a+b+c=5$, namely $\color{blue}{(a,b,c)=(1,2,2)}$.


*there is no admissible triple $(a,b,c)$ with $1\leq a=b=c\leq 3$ and $a+b+c=5$.
Conclusion: In (6) we note that thanks to symmetry only two admissible triples $\color{blue}{(a,b,c)\in\{(1,1,3),(1,2,2)\}}$ provide a contribution to the result.
