# Representability as a Sum of Three Positive Squares or Non-negative Triangular Numbers

Let $r_{2,3}(n)$ and $r_{t,3}(n)$ denote the number of ways to write $n$ as a sum of three positive squares (A063691) and as a sum of three non-negative triangular numbers (A008443), respectively. I have noticed that $r_{2,3}(8k+3) = r_{t,3}(k)$ for $k \geq 1$. For example, $r_{2,3}(11) = 3$ because $11 = 3^2 + 1^2 + 1^2 = 1^2 + 3^2 + 1^2 = 1^2 + 1^2 + 3^2$ and $r_{t,3}(1) = 3$ because $1 = 1 + 0 + 0 = 0 + 1 + 0 = 0 + 0 + 1$, where $0$ and $1$ are triangular numbers.

Is this identity well-known? If so, where can I find its proof?

A proof should follow from showing that the coefficient of the $q^{8k + 3}$ of the $q$-series of $(\sum_{n \geq 1} q^{n^{2}})^{3}$ is equal to the corresponding coefficient of the $q$-series of $\frac{1}{8} \theta^{3}_{2}(q^{4})$, where $\theta_2(q) = \theta_2(0,q)$ is a Jacobi theta function.

-
I think Gauss proved this first. – quanta Mar 12 '11 at 17:03
I'm sure it must be written out somewhere. Any ideas? – user02138 Mar 12 '11 at 17:05

It is easy enough to prove something like this for squares and triangular numbers since modulo 4, squares are 0 or 1, so any three squares adding to $8k+3$ must each be odd, and the equation $$k = \frac{a(a+1)}{2} + \frac{b(b+1)}{2} + \frac{c(c+1)}{2}$$ implies and is implied by
$$8k+3 = (2a+1)^2 + (2b+1)^2 + (2c+1)^2 .$$
It's positive squares and non-negative triangular numbers, so I don't quite understand your comment about $k = 1$. – user02138 Mar 12 '11 at 21:22