Sum of three squares as class numbers and Waldspurger's formula It is known that the number of ways to express $n \in \mathbb{Z}_{\geq 0}$ as a sum of three squares (let's denote it as $r_3(n)$) can be expressed as Hurwitz-Kronecker class number (certain weighted sum of class numbers). Such a number is closely related to a modular form of weight $3/2$, namely
$$
\theta(z)^3 = \left(\sum_{n\in \mathbb{Z}} q^{n^2}\right)^3 = \sum_{n\geq 0} r_3(n)q^n, \quad q = e^{2\pi i z}.
$$
Since the case of even number of squares (like $r_2(n)$ and $r_4(n)$ becomes integral weight modular forms, one can obtain formula for $r_{\mathrm{even}}(n)$ in terms of coefficients of integral weight modular forms by writing $\theta(z)^{\mathrm{even}}$ as a linear combination of such forms.
However, the nature of half-integral weight modular forms is much different, and this is why $r_{\mathrm{odd}}(n)$ cases are harder. But I think there should be a way to deduce formula for $r_3(n)$ using the theory of modular forms, since it is obviously related to half-integral weight modular forms. My first thought was to use Shimura correspondence and Waldspurger's formula, which attaches weight $2$ modular forms to a given weight $3/2$ cusp forms, and relate the coefficients with special $L$-values of attached modular forms, and I guess that the latter might be related to class numbers via class number formula (there are some explicit versions of Waldspurgers formula, e.g. due to Kohnen). However, the first issue is that $\theta(z)^3$ is not a cusp form and we can't apply Shimura correspondence directly.
But I think there might be a way to mitigate such an issue by decomposing $\theta(z)^3$ as a sum of cusp form and non-cusp form, where the latter one is somewhat easy to handle (for example, I may expect that it is easy to compute Fourier coefficients of it). Such an idea came out while I was reading Chao Li's article on Moonshine and BSD conjecture, especially Remark 5 of it. Since I even don't know the "well-known" proof for the formula for $r_3(n)$, I wonder if there's any work in this direction. Thanks in advance.
 A: This is not an answer, but I found a work that seems to be related to my question.
There's a paper by Ting-Yi Pei on the Eisenstein series of weight 3/2. Author defines a weight 3/2 Eisenstein series (which have to be defined carefully due to the convergence issue) and show that they generate the space of Eisenstein series of weight 3/2. Moreover, they give an explicit formula for the coefficients of the Eisenstein series. If I understood correctly, then weight 3/2 level 4 Eisenstein series have an expansion
$$
f_{1}(\mathrm{id}, 4)(z) =1 + 4\pi(1+i)\sum_{n\geq 1}\frac{L_4(1, \chi_{-n})}{L_4(2, \mathrm{id})} \beta(n) \left(A(n) - \frac{1-i}{4}\right) n^{1/2}q^{n}
$$
where
$$
L_N(s, \omega) = \sum_{(n, N) = 1}\frac{\omega(n)}{n^s} \\
\beta(n) = \beta(n, 0, \mathrm{id}, 4) = \sum_{a, b\text{ odd}, (ab)^2 |n} \mu(a) \left(\frac{-4n}{a}\right) \frac{1}{ab} \\
A(n) = A(2, n) = \begin{cases} 4^{-1}(1-i)(1 - 3 \cdot 2^{-(1 + v_2(n))/2}) & 2 \nmid v_2(n) \text{ or } 2|v_2(n), \,n/2^{v_2(n)} \equiv 1\,(\text{mod }4)\\ 
4^{-1}(1-i)(1 -2^{-v_2(n)/2}) & 2 | v_2(n),\,n/2^{v_2(n)} \equiv 3\,(\text{mod }8) \\
4^{-1}(1-i) & 2 |v_2(n), \, n/2^{v_2(n)} \equiv 7\,(\text{mod }8)
\end{cases}
$$
and this should coincide with $\theta(z)^3$ since $M_{3/2}(4, \mathrm{id})$ has dimension 1 and generated by $\theta(z)^3$. From this, one might be able to deduce the formula in terms of Hurwitz-Kronecker class numbers, and $L_4(1, \chi_{-n})$ term may contribute to that part. However, I can't figure out the details cine there are so many complicated terms included here. But at least, the coefficient of $f_1(\mathrm{id}, 4)$ is zero when $n \equiv 7\,(\text{mod }8)$ since $A(2, n) = (1-i)/4$, and in this case we have $r_3(n) =0$, too.
