Is there a nice way to write the generating function obtained by taking the quadratic coefficients of another one? Suppose that you have a generating function
$$
f(q) = \sum_{k=0}^\infty a_k q^k
$$
It's not too hard to obtain the generating function
$$
f_{n,m}(q) = \sum_{k=0}^\infty a_{nk + m}q^k
$$
by taking a creative sum of terms like $f(\zeta_n^i q)$ for appropriate roots of unity $\zeta_n$.
What about functions of the form
$$
g(q) = \sum_{k=0}^\infty a_{k^2}q^k
$$
or more generally,
$$
g_{n,m}(q) = \sum_{k=0}^\infty a_{nk^2+m}q^k
$$
Is there some way to nicely obtain these in terms of either the original generating function, or its coefficients, or anything? If it helps, the generating function that we are interested in is the inverse of the modular discriminant. That is, we are looking at
$$
f(q) = \frac{1}{\Delta(q)} = q^{-1} + 24 + 324q + 3200q^2 + \cdots
$$
where $\Delta(q) = q\prod_{k=1}^\infty (1-q^k)^{24} = \eta(q)^{24}$.
 A: There is an algebraic object naturally attached to $1/\Delta$, namely the fake monster Lie algebra.  It was introduced in Borcherds's paper The monster Lie algebra, but the word "fake" was later attached when Borcherds discovered a different Lie algebra that really has a well-behaved action of the monster simple group.  If we forget the Lie algebra structure, we get a vector space graded by the 26-dimensional even unimodular Lorentzian lattice $I\!I_{25,1}$.  The subspace whose degree is a lattice vector $v$ has dimension equal to $p_{24}(|v|^2/2+1)$, i.e., the $q^{|v|^2/2}$ coefficient of $1/\Delta$.  Generating functions of the form $\sum a_{nk^2} q^k$ are then given by the Lie subalgebras supported on rays from the origin.
The phenomenon with generating functions is a special case of the Borcherds-Harvey-Moore theta lift, where a weakly holomorphic modular form of weight $1-n/2$ is sent to a meromophic automorphic form on $O(2,n)$.  For $1/\Delta$, we have $n=26$, so we get an automorphic form on a rather large group.  The Fourier expansion at a cusp is the somewhat unwieldy character for the fake monster Lie algebra, but we can take a one dimensional slice to get the generating function manipulation you want.
