How many nonnegative integers $x_1, x_2, x_3, x_4$ satisfy $2x_1 + x_2 + x_3 + x_4 = n$? 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.

You can use a recurrence to solve this, as you already mentioned ( #(M) is the number of elements of the set M)
$$S(n)=\#(\{(x_1,x_2,x_3,x_4)| x_1+x_2+x_3+x_4 =n, x_1\ge 0,x_2\ge 0,x_3\ge 0,x_4\ge 0\})$$
$$E(n)=\#(\{(x_1,x_2,x_3,x_4)| 2x_1+x_2+x_3+x_4 =n, x_1\ge 0,x_2\ge 0,x_3\ge 0,x_4\ge 0\})$$
$$O(n)=\#(\{(x_1,x_2,x_3,x_4)| (2x_1+1)+x_2+x_3+x_4 =n, x_1\ge 0,x_2\ge 0,x_3\ge 0,x_4\ge 0\})$$
So $E(n)$ counts the tuples where the first component is even and $O(n)$ counts the tuples where the first component is odd.
We have $$S(n)=E(n)+O(n)$$
$S(n)$ can be calculated with the stars and bars method, we get
$$S(n)={ n+3\choose 3}$$
From the definitions wee see that
$$O(n)=E(n-1)$$
So we get
$$E(n)={ n+3\choose 3}-E(n-1)$$
and further
$$E(n)=\sum_{i=0}^{n}{ i+3\choose 3}(-1)^{n-i}$$
Note that ${ i+3\choose 3}$ is a polynomial of degree $3$, so a closed formula for this sum can be derived from the Faulhaber formulas if we take into account that
$$\sum_{i=0}^{2n+1}i^p(-1)^{2n+1-i}=\sum_{i=0}^{2n+1}i^p-2\sum_{i=0}^{n}(2i)^p=\sum_{i=0}^{2n+1}i^p-2^{p+1}\sum_{i=0}^{n}i^p$$
So finally we get
$$E(2n+1)=\frac{4 {{n}^{3}}+21 {{n}^{2}}+35 n+18}{6}$$
and
$$E(2n)={ 2n+4\choose 3}-E(2n+1)=\frac{4 {{n}^{3}}+15 {{n}^{2}}+17 n+6}{6}$$
