# Generating function for $r^\binom{n}{2}$

I'm trying to find a closed form of the generating function

$$G(x) = \sum_{n \ge 0} r^\binom{n}{2} x^n$$

for a real number $0 < r < 1$. I found that $G(x) = 1 + xG(rx)$. Any hints where to go next?

Taking into account the answer by @zyx below, let

$$H(x) = \sum_{n\in\mathbb{Z}} r^\binom{n}{2} x = \prod_{m\ge1} (1-r^m)(1+r^{m-1} x)(1+r^m x^{-1}),$$

where the equality of the sum and product comes from the Jacobi triple product. Note that $H(rx) = xH(x^{-1})$.

Also, using $\binom{-n}{2} = \binom{n+1}{2}$, we can obtain $\sum_{n<0} r^\binom{n}{2} x^n = xG(x^{-1})-x-1$.

Now what?

-
I added some tags that go with the Jacobi triple product. –  zyx Mar 17 '13 at 4:14
The last is wrong, $\binom{-n}{2} = (-1)^n \binom{n + 1}{1} = (-1)^n (n + 1)$ –  vonbrand Mar 17 '13 at 12:28
@vonbrand: I don't follow. $\binom{-n}{2} = \frac{-n(-n-1)}{2} = \frac{n(n+1)}{2} = \binom{n+1}{2}$ –  Snowball Mar 17 '13 at 12:48
When a theta function is $\sum_{-\infty}^\infty$, one sometimes sees the term "partial theta function" for the half-version $\sum_0^\infty$. –  GEdgar Mar 17 '13 at 12:54
By the way, for $r=2$, $G(x)$ counts the number of graphs on $n$ labelled vertices. I guess for general $r$, $G(x)$ counts the number of ways of colouring the edges of a graph on $n$ labelled vertices, with $r$ colours. Closed forms are overrated; usually it is possible to work with generating functions without them. By the way, note that this GF diverges everywhere (has radius of convergence $0$), so it is hard to apply analytic methods on it. –  ShreevatsaR Jan 9 at 9:40

The formula gives $\sum_{n=-\infty}^\infty r^\binom{n}{2} x^n = \prod_{m=1}^\infty (1 - r^m)(1 + r^{m-1} x)(1 + r^m x^{-1})$. Any suggestions on what to do about the part of the summation where $n<0$? (The g.f. I'm looking for sums over $n \ge 0$.) –  Snowball Mar 17 '13 at 8:21