Problem
COM-B2-M09-P014 Central Bounded Coefficient
Find the coefficient of \(x^{12}\) in \((1+x+x^2+x^3)^8\).
This is the number of solutions to \(a_1+\cdots+a_8=12\), where \(0\le a_i\le 3\). Use inclusion-exclusion on the conditions \(a_i\ge 4\).
Without the upper bound, there are \(\binom{19}{7}=50388\) solutions. If a chosen variable is at least \(4\), subtracting \(4\) leaves sum \(8\), giving \(\binom{15}{7}=6435\) solutions; there are \(8\) choices of the variable. For two variables, the remaining sum is \(4\), giving \(\binom{11}{7}=330\) solutions; there are \(\binom{8}{2}=28\) pairs. For three variables, the remaining sum is \(0\), giving \(1\) solution; there are \(\binom{8}{3}=56\) triples. Four variables are impossible. The desired coefficient is
\[50388-8\cdot 6435+28\cdot 330-56=8092.\]
Trains a longer but controlled inclusion-exclusion computation.