Integer solution of $a+b+c=15$ with restrictions on $a, b$ and $c$ I'm checking this problem:
Find the integer solutions of $a+b+c=15$ if $a$ is multiple of 3, $b$ is less than 10 and $c$ is multiple of 2. With $a, b, c ≥ 0$ 
We can make a series of polynomials with combinatorics. The polynomials would be:
$$P_a(x)=1+x^3+x^6+x^9+\dots$$
$$P_b(x) = 1 +x+x^2+x^3+\dots + x^9 = \frac{1-x^{10}}{1-x}$$
$$P_c(x) = 1+x^2 + x^4 + x^6 + \dots$$
I want to know if my $P_a(x)$ and $P_c(x)$ are stated correctly and how can they be simplified so that I get to $x^{15}$ in an easier way. 
Big thanks for your help. 
 A: Without a CAS, I'm not sure there's a good way to do this.  We have $$P_a=\frac1{1-x^3}\\P_c=\frac1{1-x^2}$$  so that if $$P(x)=\frac1{(1-x)(1-x^2)(1-x^3)}=\sum_{n=0}^\infty a_nx^n$$ we want $a_{15}-a_5$.  The power series for $P(x)$ doesn't seem easy to calculate.  Putting it in WolframAlpha, I got $a_{15}=27, a_5=5$ giving an answer of $22$.  The series coefficients don't seem to follow a simple pattern.  I get$$
1,1,2,3,4,5,7,8,10,12,14,16,19,21,24,27,30,33,37,\dots$$ This turns out to be A001399, but no simple formula is given.  There are two fairly simple formulas given.  The one mentioned by Rob Pratt in the comments, and also $$a_n=\left\lfloor\frac{n^2+3}{12}\right\rfloor+\left\lfloor\frac{n+2}{2}\right\rfloor$$ I don't know how to prove either one of them.
A: You don't have to make polynomials and solve it by generating functions,
let $a=3k$, and $c=2j$ for $k,j \in \mathbb{N_0}$
$$3k + 2j + b = 15 \iff 3k+2j=15-b$$
This is a classic linear diophantine equation, and since $\gcd(2,3)=1$, it has solutions. So, all we need to do is find initial solutions to $k,j$ in terms of $b$. An obvious one is 
$$j=b \implies3k=15-3b \iff k=5-b$$
So, we know from the properties of linear diophantine equation that 
If $(x^*,y^*)$ is a solution to $ax+by=n$, then all integer solutions are in the form of 
$$\left(x^*+m\frac{b}{\gcd(a,b)},y^*-m\frac{a}{\gcd(a,b)}\right)$$
for some integer $m$. Applying that to our equation, we get:
$$(k,j) \in \left\{((5-b)+2m,b-3m) \ |\ 0 \le b<10, \ \ b \in \mathbb{N_0},m \in \mathbb{Z}\right\}$$
and one more restriction: $k \ge0 \implies m \ge \frac{b-5}{2}$ and $j \ge0 \implies m \le \frac{b}{3}$ 
So to find all solutions, you choose $b$ from this set $\{0,1,2,3,4,5,6,7,8,9\}$ and put every integer 
$$ \left\lfloor \frac{b-5}{2} \right\rfloor \le m \le\left\lfloor \frac{b}{3} \right\rfloor$$
and the resulting set would be 
$$(a,b,c) \in \{(15-3b+6m,b,2b-6m)\}$$
A: Can't this simply be done by making use of the fact that $b + c = 15 - a$ is divisible by $3$ to conclude that $15-a$ can only equal one of $0,$ $3,$ $6,$ $9,$ $12,$ $15$? In the lists below, keep in mind that the values are nonnegative and $b = 0,\,1,\,\ldots,\,9$ and $c$ is even. Thus, for example, if $b+c = 9,$ then $c$ can only be $0,\,2,\,4,\,6,\,8$ because $c \geq 0$ is even and $b \leq 9.$ Each of these $5$ values of $c$ in this example is also easily seen correspond to a unique solution for $(a,b,c).$
$a=15$ and $b+c=0$
There is only $1$ solution, namely $(b,c) = (0,0).$
$a=12$ and $b+c=3$
There are $2$ solutions, namely $(b,c) = (1,2),\;(3,0).$
$a=9$ and $b+c=6$
There are $4$ solutions, namely $(b,c) = (0,6),\;(2,4),\;(4,2),\;(6,0).$
$a=6$ and $b+c=9$
There are $5$ solutions, namely $(b,c) = (1,8),\;(3,6),\;(5,4),\;(7,2),\,(9,0).$
$a=3$ and $b+c=12$
There are $5$ solutions, namely $(b,c) = (0,12),\;(2,10),\;(4,8),\;(6,6),\,(8,4).$ (No more, because we must have $b \leq 9.)$
$a=0$ and $b+c=15$
There are $5$ solutions, namely $(b,c) = (1,14),\;(3,12),\;(5,10),\;(7,8),\,(9,6).$
Therefore, altogether there are $1+2+4+5+5+5 = 22$ solutions.
A: Um.... why do work when simply counting them is magnitudes of effort easier.  
$a = 3k; k=0... 5$.  $c$ is even so $b$ is odd if and only if $a$ and $k$ are even.  So $b$ can be any even/odd number $\le \min (15-a, 10)$ and $c = 15-a -b$.
Just count them.  If $a=0$ then $b=1,3,...,9$ and $c= 15-b$ and there are $5$ such solutions.
If $a=3$ the $b=0,...,8$ and $c = 12-b$ and there are $5$ such solutions.
If $a = 6$ then $b=1,....9$ and $c = 9-b$ and there are $5$ such solutions.
If $a = 9$ then $b=0,2,4,6$ and $c =6-b$ and there are $4$ such solutions.
If $a= 12$ then $b=1,3$ and $c=3-b$ and there are $2$ such solutions.
If $a = 15$ then $b = 0$ and $c = 0$ and there is $1$ such solution.
So there are $5+5+5+4+2 +1=22$ solutions.
