Closed form of a generating function $\sum _{n=1}^\infty x^{n^2}$
Solution 1:
Using parity to extend the summation to all integers, one can recognize in the resulting expression Jacobi theta function $\vartheta_3(z,q)=\sum_{n\in\mathbb Z}q^{n^2} e^{2ni z}$. More precisely, we have $$\sum_{n=1}^{\infty}x^{n^2}=\frac{\vartheta_3(0,x)-1}{2}.$$