How many nonnegative integers $x_1, x_2, x_3, x_4$ satisfy $2x_1 + x_2 + x_3 + x_4 = n$

combinatoricsrecurrence-relations

Can anyone give some hints about the following question?

How many nonnegative integers $x_1, x_2, x_3, x_4$ satisfy $2x_1 + x_2 + x_3 + x_4 = n$?

Normally this kind of question uses stars and bars but there are $2x_1$, which I don’t know how to handle. Help please!

Ps :I think may be we can use recurrence relation.

Best Answer

One idea is to deal with $x_1$ separately in order to use stars and bars on $x_2,x_3,x_4$. For example you fix $x_1=0$ and then you have $x_2+x_3+x_4=n$ or you fix $x_1=1$ and then get $x_2+x_3+x_4=n-2$ and so on and so forth. This then generates the summations $$x_2+x_3+x_4=n-2i$$ which have ${n-2i+2 \choose 2}$ solutions. Thus as $x_1$ can be a number between $0$ and $\lfloor n/2\rfloor$ you get the summation $$\sum_{i=0}^{\lfloor n/2\rfloor}{n-2i+2 \choose 2}.$$