I know how to find integer solutions to equations of the form $x_1+x_2+x_3=n$. You would use stars and bars and do ${n+2}\choose{2}$.
But what if the equation is of the form $x_1+3x_2+4x_3=n$. This is for the problem where you want to distribute n candies among 3 different sized boxes. One size holds one candy, another holds $3$ candies, and the other holds $4$ candies. And each box must be completely filled.
Is it even possible to use the equation approach to this problem? And if so, how?