Let $G(n)$ denote the weighted number of $\mathrm{SL}_2(\mathbb{Z})$-equivalence classes of positive definite quadratic forms $$[a,b,c]:=ax^2+bxy+cy^2$$ with $2\mid b$ and $ac-b^2=n$$b^2-4ac=-4n$, where the classes represented by $[a,0,a]$ have weight $1/2$, the classes represented by $[a,a,a]$ have weight $1/3$, and all other classes have weight $1$.
Gauss (1801) proved the following formula for $n\equiv 1,2\pmod{4}$: $$\left|\left\{(a_1,a_2,a_3)\in\mathbb{Z}^3\,:\, a_1^2+a_2^2+a_3^2=n \right\}\right|=12G(n).$$ On the other hand, Mordell (1923) proved for every $n>0$ that $3G(n)$ counts the number of solutions of $a_1a_2+a_2a_3+a_3a_1=n$ in nonnegative integers if a weight $1/2$ is attached to the solutions with $a_1a_2a_3=0$. From here we obtain with a bit of combinatorics that $$\left|\left\{(a_1,a_2,a_3)\in\mathbb{Z}^3\,:\, |a_1a_2|+|a_2a_3|+|a_1a_3|=n \right\}\right|=24G(n).$$ Comparing the last two displays, the conjectured formula follows.
P.S. Mordell (1923) published his theorem in the American Journal of Mathematics (vol. 45, pp. 1-4), but he also included it in Chapter 30 of his book "Diophantine equations".