Problem
COM-B2-M09-P013 Six Bounded Summands
Find the number of integer solutions to \(a_1+\cdots+a_6=24\), where \(1\le a_i\le 7\) for all \(i\).
First remove the lower bound: set \(b_i=a_i-1\).
Let \(b_i=a_i-1\). Then \(b_1+\cdots+b_6=18\) and \(0\le b_i\le 6\). Without the upper bound, there are \(\binom{23}{5}=33649\) solutions. If one \(b_i\ge 7\), the remaining sum is \(11\), giving \(\binom{16}{5}=4368\) solutions; there are \(6\) choices of the variable. If two \(b_i\ge 7\), the remaining sum is \(4\), giving \(\binom{9}{5}=126\) solutions; there are \(\binom{6}{2}=15\) pairs. Three variables cannot be at least \(7\), because the remaining sum would be negative. The answer is \(33649-6\cdot 4368+15\cdot 126=9331\).
The level is higher because two shifts are needed: a lower-bound shift and an upper-bound correction.