5

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?

rasen58
  • 165
  • 4
    Generating functions are often useful to solve these types of problems (see e.g. this). It reduces the problem to a purely technical one of finding the power-series coefficients of a certain function. – Winther Dec 26 '15 at 16:23
  • It would improve the Question if you specified what the goal is: find whether a solution exists, find all possible solutions, or give a count of all possible solutions. – hardmath Dec 26 '15 at 17:03

1 Answers1

2

In this case, your problem is analogous to:

Finding the coefficient of $t^n$ in the expansion of $$(1+t+t^2+t^3+\dots)(1+t^3+t^6+t^9+\dots)(1+t^4+t^8+t^{12}+\dots)$$

You can relate your question to this in the following way:
General term of the above expansion = $t^{x_1}\cdot t^{3x_2}\cdot t^{4x_3}=t^{x_1+3x_2+4x_3}$

And we are requiring the coefficient of $t^n$.

So the coefficient will be equal to the number of solutions of $x_1+3x_2+4x_3=n$.