How many solutions belonging to $\mathbb N$ are to the equation: $$ a_1+a_2+\dots +a_{10}+b_1+b_2+\dots+b_5=7 $$ if $0\le a_i \le 2$ for $1\le i\le 10$ and $b_i$ is divisible by $3$ for $1\le i\le 5$?
I want to solve this using generating functions. I think we can create the function: $$ f(a,b)=(1+x+x^2)^{10}(y^3+y^6+y^9+\dots)^5\\ =(1+x+x^2)^{10}y^{15}(1+y^2+y^3+\dots) $$ but as far as I understand I need to find the coefficient of $a^xb^y$ such that $x+y=7$ but there's $y^{15}$ already in the expression. Is my function wrong or am I missing something?
You forgot that $0$ is also divisible by $3$, so your $b_i \in\{0,3\}$. Resulting generating function should be $$ f(x,y) = \left(1+x+x^2\right)^{10} \left(1 + y^3 + \ldots \right)^5 $$
In addition, I don't really understand why you need a 2-variable generating function. You can likely find $\left[x^7\right]g(x)$ for $g(x) = f(x,x)$.