Problem: Find the number of solutions for the equation $ 3x+2y + 3z = n $ where $ x,y,z \in \Bbb N$ and $n \equiv 1 \mod(6) $.
Note: I'm supposed to use generating functions. Also, I found questions about the above equation but none of them talk about the modulo.
Attempt: Notice that $ 3x \in \{ 3n | n \in \Bbb N \} , 3z \in \{ 3n | n \in \Bbb N \}, 2y \in \Bbb N_{even} $. Denote $ t_1 \ = 3x , t_2 = 3z , t_3 = 2y $. So we'll search for generating functions that correspond to the equation $ t_1 + t_2 +t_3 = n $, hence we'll have $ ( x^0+ x^3 + x^6 + ...)( x^0+ x^3 + x^6 + ...)( x^0+ x^2 + x^4 + ...) = (\sum (x^3)^k)(\sum (x^3)^k)(\sum (x^2)^k) = \frac{1}{(1-x^3)^2} \frac{1}{1-x^2} $ [ Here I've stopped ].
Then I need to do partial fractions decomposition but the result is terribly long - I'm not sure if I need to even do the decomposition ( maybe there's a shorter way to reach the coefficient $ n $? moreover I'm not really sure what coefficient $ n $ they mean, are they seeking a specific $ n $ s.t. $ n ~mod~ 6 = 1 $? because If not there are infinitely many such n's. In any case, how would you solve the problem?. Thanks in advance!
Let's regroup $x$ and $z$ under the same banner $t=x+z$.
There are $t+1$ possibilities to choose $x,z$, simply because we can make $x\in\{0,1,\cdots t\}$ and then $z$ is uniquely determined by $z=t-x$.
Let $n=6k+1$ then the reduced equation becomes:
$$3t+2y=6k+1$$
Notice that $\begin{cases}3t+2y\equiv t\equiv 1\pmod 2\\3t+2y\equiv 2y\equiv -y\equiv 1\pmod 3\end{cases}\iff\begin{cases}t=2i+1\\y=3j+2\end{cases}$
Reporting in the equation gives us:
$$3(2i+1)+2(3j+2)=6k+1\iff 6i+6j+7=6k+1\iff i+j=k-1$$
Which we have just seen above has $k$ solutions for $i=0\cdots k-1$.
The number of overall solutions is then:
$\sum\limits_{i=0}^{k-1}\operatorname{nbsol}(x+z=t)=\sum\limits_{i=0}^{k-1}(t+1)=\sum\limits_{i=0}^{k-1}(2i+2)=2\sum\limits_{i=1}^{k}i=2\times\dfrac{k(k+1)}{2}=k(k+1)$