Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to solve this problem with generating function :

How many solutions(non-negative) possible for the equation $${2x}+{3y}+{7z}={r}$$$(r \ge0)$ such that :

1)$x,y,z \ge0$

2)$0 \le z\le 2 \le y \le 8 \le x$

share|cite|improve this question
If $r$ is given (and $x,y,z$ are unknowns that comprise the solution), you should explain that in the question. The answer "how many solutions" then depends on $r$, right? – hardmath Dec 27 '12 at 17:22
Also, you explicitly state that the variables are supposed to take integer values, otherwise the question becomes quite boring... – Ben Millwood Dec 27 '12 at 17:29
I edited question. – Martin Dec 27 '12 at 17:41

$\textbf{Hint: }$Note that the number of soloutions is given by the coefficient of $z^r$ in the expansion of the following expression : $$\left((z^2)^8+(z^2)^9+(z^2)^{10}+\cdots \right)\left((z^3)^2+(z^3)^3+\cdots +(z^3)^8\right)\left((z^7)^0+(z^7)^1+(z^7)^2\right)$$ and the first expression can be written as $z^{16}(1-z^2)^{-1}.$

share|cite|improve this answer
Thanks. In part 1, we have :$$\left((z^2)^0+(z^2)^1+(z^2)^{2}+\cdots \right)\left((z^3)^0+(z^3)^1+\cdots \right)\left((z^7)^0+(z^7)^1+(z^7)^2+\cdots\right)$$ , How to get $z^{16}(1-z^2)^{-1}.$,,,, and in part 2 , How to get closed form? – Martin Dec 27 '12 at 17:57
@Martin: Note that all the three expressions are Geometric Progression (the first one is infinite) , use the usual formulas to simplify them. – pritam Dec 27 '12 at 18:03

Let $\xi = x^2$, then by the restriction placed on $x$, we have the generating function $$ (\xi^8 + \xi^9 + \xi^{10} + \dots) = \xi^8(1+ \xi^2 + \xi^3 + \dots) = x^{16}/(1-x^2). $$ To handle the $y$ term, let $\eta = x^3$, then $$ \begin{align*} (\eta^ + \eta^3 + \dots + \eta^8) &= \eta^2(1 + \eta + \eta^2 + \dots + \eta^6)\\ &= \eta^2 \frac{1-\eta^7}{1-\eta}\\ &= x^6 \frac{1-x^{21}}{1-x^3} \end{align*} $$ Lastly, to handle the $z$ term, let $\zeta = x^3$, then $$ (\zeta^0 + \zeta^1 + \zeta^2) = (1-x^21)/(1-x^7) $$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.