Closed-form for $\sum_k r^{k^2}$?

74 Views Asked by At

Let $r \neq 1$. A finite geometric series $$ \sum_{k=0}^n r^k = \frac{1 - r^{n+1}}{1 - r} $$ is well-known and it has a nice closed-form. Let me modify the exponents of the summands from linear to quadratic. $$ \sum_{k=0}^n r^{k^2} $$ What is a closed-form for this series? Surprisingly I find this quite challenging. Apparently, WolframAlpha doesn't know what to do either. Part of the reason might be the series is no longer hypergeometric. Does anyone know an answer? What if we admit a generating function $g(z) = \sum_{n=0}^\infty \left(\sum_{k=0}^n r^{k^2}\right)\frac{z^n}{n!}$ instead?