I've tried equating the coefficients of the rational expression below but cannot terminate the coefficients i.e. find a finite $N$ and $M$:
$$ \sum_{k = 0}^{\infty} x^{k^2} = \frac{\displaystyle \sum_{k = 0}^{N} b_k x^k}{1 + \displaystyle \sum_{k = 1}^{M} a_k x^k}$$
$$ \left(\sum_{k = 0}^{\infty} x^{k^2} \right) \left( 1 + \displaystyle \sum_{k = 1}^{M} a_k x^k\right) = \sum_{k = 0}^{N} b_k x^k$$