Let $n$ be a positive integer.
The question is, how many ways are there, to write $n$ as $\sum_i a_i^2$, where $a_i$ are some positive integers.
The lenght of $a_i$ is irrelevant so that one could formulate this abstractly as follows. Let $$P_n := \{ a = (a_i)_{i\in \mathbb{N}} \in \mathbb{N}^{(\mathbb{N})} | \sum_{i} a_i^2 = n \text{ and } a_j = 0 \implies a_k = 0 \ \forall \ k \geq j \}.$$ Then, what is the size of $P_n$?
(I write $\mathbb{N}^{(\mathbb{N})}$ for sequences with values in $\mathbb{N}$ that are eventually $0$).
So far, I have a recursive formula:
$P_n = \coprod_{x \leq \sqrt{n}} P_{n - x^2}$
With this, one could compute the exact value for a given number, but the number of terms gets large quickly. (I wrote a basic program but the results neither enable me to find a formula, nor to reach numbers greater than ~60).
If a closed formula for the size of $P_n$ seems to be difficult, I would also be interested in upper bounding it, such that the upper bound is not to far off.
I couldn't find anything in literature (e.g. by using Google) but maybe I am missing the correct words, so I would also appreciate any hints on that direction.
If $p_n$ is the cardinality of $P_n$ then $\log_2 p_n$ is approximately $\frac n2$. I wrote a little python script to compute the values and graph them.
This produced
This looks like a good starting point to me.