Let $q=\exp(2 \pi i z)$ and $$\theta(z)=\sum_{n=-\infty}^\infty q^{n^2}.$$
Now, I shall show that the powers of $\theta$ are given by
$$\theta(z)^r = \sum_{n=0}^\infty S_r(n) q^n$$
where $S_r(n)$ denotes to the number of $z\in \mathbb{Z}^r$ s.t. $||z||^2=n$.
Who can help me to show that these $S_r(n)$ are the right coefficients for $\theta^r$?
There is nothing deeper here then the multiplication of power series,
$$(\sum_{n=-\infty}^\infty x^{n^2})^r=(\sum_{a=-\infty}^\infty x^{a^2})(\sum_{b=-\infty}^\infty x^{b^2})(\sum_{c=-\infty}^\infty x^{c^2})...=(\sum_{a=-\infty}^\infty\sum_{b=-\infty}^\infty\sum_{c=-\infty}^\infty x^{a^2+b^2+c^2..})$$ $$\text{ Which is just a sum over all ordered pairs (a,b,c,....)}$$
$$\text{Where each member is an integer ranging from negative infinity to positive infinity}$$ $$\text{ so that, $\theta(x)^r$}=\sum_{(a,b,c..)}x^{a^2+b^2+c^2...}$$ $$\text{ with the sum running over all integer pairs $(a,b,c,..)$}$$ $$\text{ Also note that every term will be of the form $x^n$, with $0\leq n$} $$
$$\text{Sense each exponent is a sum of squares with each square being positive}$$ $$\text{ So that means we have, $\theta(x)^r=\sum_{n=0}^\infty c_n x^n$}$$ $$\text{ For some suitable coeffients $c_n$}$$ $$\text{ Also realize that the exponents originally were, $a^2+b^2+c^2...$}$$ $$\text{ So that the nth exponent will correspond to $n=a^2+b^2+c^2..$}$$ $$\text{ Which means that each coeiffient will correspond to the number of ways $n=a^2+b^2+c^2...$}$$ $$\text{ Where the only constraints on $(a,b,c,..)$ are the previous ones}$$ $$\text{ Namely $(a,b,c,...)$ be distinct integer pairs where each elements is an integer}$$ $$\text{ We can also just constrain the integer pairs to be distinct for each coeiffient}$$ Because they can't be the same for any different exponents n and j, because this would imply $n=j$