# Finding number of summands by using generating function

I did something wrong in the calculations, but I can't find the error. I've recalculated it many times and checked it in many different ways. Here're the calculations: http://pastebin.com/yUvnmKTm But, in the nutshell, the task:

$x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 29$

But, there must be exactly 3 odd $x_i$, every $x_i$ must be greater then 1.

If I solve this using generating function, as in:

$(k^2 + k^4 + \dots + k^{18})^3(k^3 + k^5 + \dots + k^{17})^3$

The coefficient in front of $k^{29}$ is 792. But this number doesn't correspond to anything. Neither the number of sequences of summands, nor the number of sets of summands. In particular, if solutions such as $(2, 3, 4, 6, 7, 7)$ and $(2, 3, 4, 7, 6, 7)$ are considered distinct, then there are 15840 such sequences. 74 otherwise.

What did I miss?

PS. I'm sorry for the probably vague formulation of the task, ironically, neither the language of the task, nor English are my native tongue. And I really don't know whether it is asking to find all possible summands, or all permutations of all possible summands.

-
The coefficient of $k^{29}$ in your generating function counts the number of sequences where the first three terms are even, the second three terms are odd, all terms are greater than $1$, and the sum is $29$. According to WolframAlpha, the coefficient of $k^{29}$ in your generating function is $792$. To remove the (undesired) restriction that the even terms come first, you must multiply the count by ${{6}\choose{3}}=20$, giving $15840$. –  mjqxxxx Jul 2 '12 at 23:54
@mjqxxxx, may I encourage you to elevate your comment to an answer? –  Gerry Myerson Jul 3 '12 at 0:18
Yes, please, @mjqxxxx that answers it. Sorry, that was a silly typo, I got the same result as you get from WolframAlpha (you can see that in the print in the pastebin code), just typed it here incorrectly. –  wvxvw Jul 3 '12 at 6:53

The coefficient of $k^{29}$ in your generating function counts the number of sequences where the first three terms are even, the second three terms are odd, all terms are greater than $1$, and the sum is $29$. According to WolframAlpha, the coefficient of $k^{29}$ in your generating function is $792$. To remove the (undesired) restriction that the even terms come first, you must multiply the count by ${{6}\choose{3}}=20$, giving $15840$.