How to find the number of solutions to $x_1+x_2+x_3+x_4+y_1+y_2=6$ if for $0\le i\le 4$ $0\le x_i \le 2$ and $y_1, y_2$ is divisible by $3$ without using generating functions? $x_i, y_k$ are non-negative integers.
I'm having trouble with manual counting of solutions. I tried using inclusion/exclusion principle: for $0\le i\le 4$ let $A_i$ be the solutions set when $x_i\ge 3$. There are $4$ such sets like $A_i$. Then we have two sets $B_1, B_2$ when $y_{1,2}$ is not divided by $3$, hence $y_{1,2}$ can be $1,2,4,5$. Therefore $|B_{1,2}|=4, |A_i|={6-2-1+6-3\choose 6-3}$ (because we have only $6-2$ bins for $x_i$ and in each bin there can be at most $6-3$ numbers.
Then we can find all intersections of two sets from $A_i$ and $B_j$. There are ${4\choose 2}$ intersections of $A_i\cap A_j$ and $|A_i\cap A_j|={6-2-1+6-3-3\choose 6-3-3}$, there's one intersection $|B_1\cap B_2|=4\cdot 4$ and there're ${4\choose 1}{2\choose 1}$ intersections of $|A_i\cap B_k|={6-2-1+3\choose 3}\cdot 4$.
There's a total of $U={6-1+6\choose 6}$ solutions to the equation.
Then to find the solutions under the given constraints the answer would be: $$ U-\biggl(\sum_{i=0}^4 A_i\biggr)-B_1-B_2+{4\choose 2}A_i\cap A_j+B_1\cap B_2+{4\choose 1}{2\choose 1}A_i\cap B_k=1036 $$ which I'm pretty sure is not the correct answer. I did try to solve this using generating functions in order to check if my solutions is correct and I got $54$ which I find to be much more reasonable.
EDIT: I decided to add the calculation using generating functions as a reference for searching the correct answer.
The generating function for this problem is: $$ f(x)=(1+x+x^2)^4(1+x^3+x^6+\dots)^2 $$ The closed form is: $$ \bigg(\frac{1-x^3}{1-x}\bigg)^4\cdot \bigg(\frac{1}{1-x^3}\bigg)^2=\frac{(1-x^3)^2}{(1-x)^4} $$ and to find the coefficient of $x^6$: $$ \sum_{k=0}^2{2\choose k} (-1)^kx^{3k}\cdot \sum_{i=0}^{\infty}{4-1+i\choose i}x^i $$ Finally the coefficient is: $$ {2\choose 0}{4-1+6\choose 6}-{2\choose 1}{4-1+3\choose 3}+{2\choose 2}{4-1+0\choose 0}=45 $$
Case by case (definitely somewhat error prone):
The $y_i's$ can be $0,3,6$.
Case I: one of them is $6$. Then all the others are $0$. $\boxed 2$
Case II: Two of them are $3$. Then all the others are $0$. $\boxed 1$.
Case III: one of them is $3$. Two places to put that $3$. the $x_i$ must then sum to $3$.
IIIa: No $2's$. Then we have three $1's$ and a $0$. $\underline 4$.
IIIb: One $2$. Then we have four places to put the $2$ and three to put the $1$ so $\underline {12}$.
In total $$2\times (4+12)=\boxed {32}$$
Case IV: No $3's$. Then the $x_i$ must sum to $6$. To do that we need at least two $2's$.
IVa: two $2's$ and two $1's$. Then $\binom 42=\underline 6$
IVb: Three $2's$ and one $0$. $\underline 4$
In total $$6+4=\boxed {10}$$
Combining we get $$2+1+32+10=\boxed {45}$$
Note: In a comment I had said I got to $56$ but that was a blunder. I did warn that this method is somewhat error prone.