Coefficients of polynomial $f_n(q)=\prod_{k=1}^{n}(1+q^k)$

analytic-number-theoryinfinite-productproductsq-analogssequences-and-series

What is the general formula for the coefficient $c_n(k)$ where
$$f_n(q)=\prod_{j=1}^{n}(1+q^j)=\sum_{k=0}^{n(n+1)/2}c_n(k)q^k?$$

I came across this problem while researching $q$-analogs. Indeed, the polynomial in question is trivially given by
$$f_n(q)=(-q;q)_n$$
where $(a;q)_n=\prod_{k=0}^{n-1}(1-aq^k)$ is the $q$-Pochhammer symbol. From Wikipedia, I read that
$$f_n(q)=\sum_{j=0}^{n}\left[{{n}\atop{j}}\right]_{q^2}q^j\tag{1}$$
where
$$\left[{{n}\atop{j}}\right]_{q}=\frac{(q;q)_n}{(q;q)_j(q;q)_{n-j}}.$$
While $(1)$ is a cool identity nonetheless, it does not provide me with what I'm looking for, as $\left[{{n}\atop{j}}\right]_{q^2}$ is still dependent on $q$.

I worked out the first few polynomials by hand:
$$\begin{align}
f_1(q)&=1+q\\
f_2(q)&=1+q+q^2+q^3\\
f_3(q)&=1+q+q^2+2q^3+q^4+q^5+q^6\\
f_4(q)&=1+q+q^2+2q^3+2q^4+2q^5+2q^6+2q^7+q^8+q^9+q^{10}\\
f_5(q)&=1+q+q^2+2q^3+2q^4+3q^5+3q^6+3q^7+3q^8+3q^9+3q^{10}+2q^{11}+2q^{12}\\
&+q^{13}+q^{14}+q^{15}.
\end{align}$$

It seems as if, in general, $$c_n(k)=c_n(n(n+1)/2-k).$$

I started trying to find recurrence relations. I saw that
$$c_3(k)=\begin{cases} c_2(k) & 0\le k\le 2 \\ c_2(k)+c_2(k-3) & k=3 \\ c_2(k-3) & 4\le k \le 6 \end{cases}$$
and similarly
$$c_4(k)=\begin{cases} c_3(k) & 0\le k\le 3 \\ c_3(k)+c_3(k-4) & 4\le k\le 6 \\ c_3(k-4) & 7\le k\le 10 \end{cases}$$
as well as
$$c_5(k)=\begin{cases} c_4(k) & 0\le k\le 4 \\ c_4(k)+c_4(k-5) & 5\le k\le 10 \\ c_4(k-5) & 11\le k\le 15 \end{cases}$$
which hints at the general expression
$$c_n(k)=\begin{cases} c_{n-1}(k) & 0\le k\le n-1 \\ c_{n-1}(k)+c_{n-1}(k-n) & n\le k\le n(n-1)/2 \\ c_{n-1}(k-n) & 1+n(n-1)/2\le k\le n(n+1)/2 \end{cases} .\tag{2}$$

This looks promising, but I am not sure if it is correct, because I just found it from basically guessing/recognizing a pattern which is not the most rigorous approach. Could someone verify $(2)$ and/or provide a simpler form of it? I ask this because I want to eventually find the coefficients $C(k)$ in
$$(-q;q)_\infty=\sum_{k\ge0}C(k)q^k$$
by taking $\lim_{n\to\infty}c_n(k)$.


Edit:

It may or may not help to note that, since $f_n(1)=\prod_{k=1}^{n}2=2^n$, we have the interesting identity
$$\sum_{k=0}^{n}c_n(k)=2^n.$$

Best Answer

Too long for a comments.

Openning the brackets, you get $q^k$ exactly when you can write $$k=i_1+i_2+....+i_j$$ for $1\leq i_1< i_2< .... < u_j \leq n$

Therefore $c_n(k)=$ is the number of ways $k$ can be written as a sum of distinct integers in $\{1,2,3,.., n\}$.

Alternately, if for each $ A \subset \{ 1,2,3,..,n \}$ you define $f(A)=\sum_{k \in A} k$, then $c_n(k)$ is simply the number of subset $A \subset \{ 1,2,3,..,n \}$ for each $f(A)=k$.

Now, the relation $$c_n(k)=c_n(n(n+1)/2-k) \,.$$ becomes obvious: If $f(A)=k$ then $f(\{ 1,2,..., n\} \backslash A)= n(n+1)/2-k$. In other words, the complement is a bijection between the number of subset $A \subset \{ 1,2,3,..,n \}$ such that $f(A)=k$ and the number of subset $A \subset \{ 1,2,3,..,n \}$ such that $f(A)=n(n+1)/2-k$.

You can also see $$\sum_{k=0}^{n}c_n(k)=2^n.$$ as a consequence that there are exatly $2^n$ subsets on $\{1,2,..,n\}$.