Eight-square representation formula (source code)

= Eight-square representation formula
{title2=$r_8(n)=16(-1)^n\sum_{d\mid n}(-1)^dd^3\quad(n>0)$}

The number $r_8(n)$ of ordered <integer> eight-tuples whose squares sum to $n$ satisfies
$$
r_8(n)=16(-1)^n\sum_{d\mid n}(-1)^d d^3\qquad(n>0),
$$
with $r_8(0)=1$ separately. For the <theta series of integer squares> $\theta(\tau)=\sum_{m\in\mathbb Z}e^{2\pi im^2\tau}$, the precise shifted identity is
$$
\theta(\tau+1/2)^8=\frac{16E_4(2\tau)-E_4(\tau)}{15},
$$
where $E_4$ is the normalized <Eisenstein series> with constant <Fourier coefficient> one. The coefficient of $q^n$, $q=e^{2\pi i\tau}$, on the left is $(-1)^n r_8(n)$, because an <integer> and its square have the same parity. Comparing the <Fourier coefficients> with the divisor-sum expansion of $E_4$ gives the displayed formula. For example, $r_8(1)=16$, from choosing one of eight coordinates and either sign.