# Sum of four Squares relation

Cheers,

As is well known due to Lagrange the number of ways to write $$n$$ as a sum of four squares is given by $$r_4(n)=8\sum_{d|n} d$$ if $$n$$ is odd.

Now define $$\tilde{r}_4(n)=\#\left\{1 + \sum_{i=1}^{4} n_i(n_i+1) = n \,\Big|\, (n_1,n_2,n_3,n_4) \in {\mathbb Z}^4 \right\}$$ and clearly only for odd $$n$$ is $$\tilde{r}_4(n)>0$$ since $$n_i(n_i+1)$$ is even.

I'm trying to show that $$\tilde{r}_4(n)=2\,r_4(n)$$ for odd $$n$$, but I lack a clever idea :-(

Background: This problem arises if one tries to proof $$\theta_2(0;q)^4 - \theta_3(0;q)^4 + \theta_4(0;q)^4 = 0$$ where $$\theta_i(0;q)$$ is the Jacobi Theta function. So maybe there is another way to proof this identity from which the original question then follows.

$$1+\sum_{k=1}^{4}n_k(n_k+1)=n$$ is equivalent to
$$\sum_{k=1}^{4}(2n_k+1)^2 = 4n$$ so $$\tilde{r}_4(n)$$ accounts for the number of ways for writing $$4n$$ as the sum of four odd squares.
On the other hand $$a^2+b^2+c^2+d^2 = 4n$$ implies that $$a,b,c,d$$ have the same parity, hence $$\tilde{r}_4(n) = r_4(4n)-r_4(n) =2\,r_4(n).$$