[Math] Combinatorics: Generating Function related to compositions of a number

combinatoricsgenerating-functionsinteger-partitions

My goal is to find the coefficients of the generating function for the following situation:

The number $f(n)$ is the sum over all compositions of $n$ into $3$ parts of the product of those parts.
Fo instance, if $n=5$, it can be written as sums of three integers in six ways: $$1+3+1, 3+1+1, 1+1+3, 2+2+1, 2+1+2, 1+2+2.$$

Taking the sum of the products of these groups, we get a number for $f(5)$:
$$3+3+3+4+4+4 = 21.$$

I need to find a formula for these numbers. I've solved a few by brute force and I determined that they are the numbers in the 6th diagonal of Pascal's triangle, but I don't want to put that as an explanation. Is there an easy way to do this with generating functions? I would assume that is what is expected of me.

Any insight would be appreciated.

Thanks very much!

Edit: The number of parts is always three, and yes, these are compositions, not partitions. I apologize for any confusion.

Best Answer

Hint: $(2\cdot 2\cdot 1)\cdot x^{2+2+1} = (2x^2)(2x^2)(x)$. So what could the generating function look like?

Details: If $a_n$ is your count, then we can write:

$$\sum a_nx^n = (x+2x^2+3x^3\dots + nx^n+\dots)^3$$

Do you know a closed form for $\sum nx^n$?

Related Question