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$$
Let $c_{k^2} = 1, c_k = 0$ otherwise.
Assume that $$\sum_{k=0}^\infty c_k x^k = \frac{\sum_{k=0}^N b_k x^k}{\sum_{k=0}^M a_k x^k}$$ Then the coefficients $c_k$ satisfy the linear recurrence $$\sum_{m=0}^M c_{k-m} a_m = b_k \qquad \qquad (1)$$
But this is impossible, since $|(n+1)^2-n^2| \to \infty$, hence for $n > 2M$ :
$c_{n^2-m} = 0$ for $0 < m < M$, and $(1)$ for $k = n^2$ becomes $c_{n^2}= b_{n^2}$, a contradiction with $b_k = 0$ for $k > N$