# Non negative solutions and generating functions

I need to find the number of solutions with non negative integers for the equation $x_1 + 8x_2 + x_3 + 2x_4 = n$, with $x_1\le 7$ and $2\le x_3\le 3$.

I used generating functions and got to the solution that the amount is $n-1$ for $2\le n$ (for $n=0$ or $n=1$ there are no solutions).

It seems to me that this amount is rather small so I'm not sure if I'm right. If it helps, before starting with the generating functions I transformed the equation to $y_1 + y_2 + y_3 + y_4 = n-2$.

• It would probably be easier if you posted your solution and let people have a shot at seeing whether it holds water. – Gerry Myerson Sep 9 '17 at 12:24

• Transform to $y_1+y_3 =n-2$. – Donald Splutterwit Sep 9 '17 at 12:51