# How to find number of combinations from a generating function

i have the following generating function:

$$(1 + z^1 + z^2 ..... + z^7)^5$$

to get the coefficient of the $$z^{25}$$ I would think that it would be 14 choose 10, but I was told that is wrong.

How would I find the correct coefficient of $$z^{25}$$ ?

• How did you come up with that answer? As an aside, everyone asks dumb questions, but pointing out what was wrong in your reasoning can help you improve. – Toby Mak Mar 18 at 8:25
• You can take a look at this similar question. – Toby Mak Mar 18 at 8:30
• Do you know any other way of writing $1 + z + z^2 + \cdots + z^n$? – M. Vinay Mar 18 at 8:47
• See math.stackexchange.com/questions/989862/… for another very similar question. – Mike Earnest Mar 18 at 15:26

When trying to play around with these sorts of questions, Wolfram Alpha is brilliant at letting you try out ideas and check your answer.

I've put your question into it and you can access the result at; https://www.wolframalpha.com/input/?i=(1%2Bz%2Bz%5E2%2Bz%5E3%2Bz%5E4%2Bz%5E5%2Bz%5E6%2Bz%5E7)%5E5

To do it by hand you need to spot that there is a Geometric Progression inside the brackets.

Is that enough of a clue ?

Or do you want more help ?

$$(1+z+z^2+...+z^7)^5 =\\ \left(\frac{z^8-1}{z-1}\right)^5 =\\ \left(\frac{(z^4+1)(z^2+1)(z+1)(z-1)}{z-1}\right)^5 =\\ (z^4+1)^5(z^2+1)^5(z+1)^5 =\\ (z^{20}+5z^{16}+10z^{12}+...)(z^{10}+5z^8+...)(z^5+5z^4+10z^3+...)$$

Possible sums of exponents that give 25, and the associated coefficient: $$20+4+1\implies 1\cdot10\cdot5=50\\ 20+2+3\implies 1\cdot5\cdot10=50\\ 20+0+5\implies 1\cdot1\cdot1=1\\ 16+8+1\implies 5\cdot5\cdot5=125\\ 16+6+3\implies 5\cdot10\cdot10=500\\ 16+4+5\implies 5\cdot10\cdot1=50\\ 12+10+3\implies 10\cdot1\cdot10=100\\ 12+8+5\implies 10\cdot5\cdot1=50$$

Total amount:$$926$$

Consistent with calculations made with algebraic calculators.