# Generating functions for unimodal sequences

I am reading the paper by G. Andrews "Concave and convex compositions", Ramanujan J. 31 (2013), no. 1-2, 67–82, where he introduces various counting functions for unimodal sequences (called "convex compositions" in the paper), and then he lists several generating functions without proof, and mentioning only "standard counting techniques" and referring to his book on the theory of partitions. I am rather new to partitions and would like to see how at least a few of the generating functions he lists are derived from the standard theory of partitions. A specific example is this: If $$X_d(n)$$ is the number of strictly unimodal sequences whose terms add to $$n$$ (strictly unimodal means that the sequence is first strictly increasing to a peak, then strictly decreasing from the peak), then the generating function is given by $$\sum_{n=0}^\infty X_d(n)q^n=\sum_{n=0}^\infty q^{n+1}(-q;q)_n^2$$ where $$(-q;q)_n=(1+q)(1+q^2)\cdots(1+q^n)$$

I believe that the main idea is that a unimodal sequence whose terms add to $$n$$ can be thought of as two partitions, one increasing to the peak and the other decreasing from the peak, and that should somehow account for the square in $$(-q;q)_n^2$$, because of the fact that the generating function for the number of partitions of $$n$$ into distinct parts is just $$(-q;q)_\infty$$.

You’ve basically already correctly described how this generating function is derived. I would suggest to use different summation indices on the two sides of the equation, as they have different roles. On the left, $$n$$ is the number being composed. On the right, $$n+1$$ is the largest part of the strictly unimodal composition: the peak. This accounts for the factor $$q^{n+1}$$, and $$(-q;q)_n=\prod_{k=1}^n\left(1+q^k\right)$$ is the generating function for partitions with distinct parts of size at most $$n$$. Every strictly unimodal composition with peak $$n+1$$ can be uniquely split into a strictly increasing composition with parts of size at most $$n$$, the peak, and a strictly decreasing composition with parts of size at most $$n$$. Both strictly increasing compositions and strictly decreasing compositions are in bijection with partitions.