<s>[INST] Linear equation of 4 variables I'm stuck on this Math problem :

How many solutions does the equation
$x_{1} + x_{2} + 3x_{3} + x_{4} = k$
have, where $k$ and the $x_{i}$ are non-negative integers such that $x_{1} \geq  1$, $x_{2} \leq  2$, $x_{3} \leq 1$
and $x_{4}$ is a multiple of 6.

I tried to write the possible cases for $x_{2}$ and $x_{3}$ since they are bounded.
Case $x_{2} = 2$ :


*

*Case $x_{3} = 1$ : $x_{1} + 5 + x_{4} = k$

*Case $x_{3} = 0$ : $x_{1} + 2 + x_{4} = k$


Case $x_{2} = 1$ :


*

*Case $x_{3} = 1$ : $x_{1} + 4 + x_{4} = k$

*Case $x_{3} = 0$ : $x_{1} + 1 + x_{4} = k$


Case $x_{2} = 0$ :


*

*Case $x_{3} = 1$ : $x_{1} + 3 + x_{4} = k$

*Case $x_{3} = 0$ : $x_{1} + x_{4} = k$


But now, I'm stuck. Should I try to resolve all this equations ? Am I in the right direction ? Any help would be grealty appreciated.
EDIT :
I found that the number of solutions will be given by the coefficient $a_{k}$ of $x_{k}$, i.e :
$(x^0+x^1+x^2)(x^0+x^1)(\displaystyle\sum\limits_{k=1}^\infty x^k)(\displaystyle\sum\limits_{k=0}^\infty x^{6k})$
$=(x^0+x^1+x^2)(x^0+x^1)(\frac{1}{(1-x^3)(1+x^3)})(\frac{x}{1-x})$
$=\frac{x+2x^2+2x^3+x^4}{(x^3-1)(x^3+1)(x-1)}$
Now I don't know how to find the $a_{k}$ coefficient.
 [/INST] This will give you a start: it's the coefficient of $x^k$ in $$(x+x^2+x^3+\dots)(1+x+x^2)(1+x^3)(1+x^6+x^{12}+\dots)$$
</s>