TITLE: Realization of numbers as a sum of three squares via right-angled tetrahedra
QUESTION [13 upvotes]: De Gua's theorem 
is a $3$-dimensional analog of the Pythagorean theorem:
The square of the area of the diagonal face of a right-angled tetrahedron
is the sum of the squares of the areas of the other three faces.
For certain tetrahedra, this provides a representation of
an integer $n$ as the sum of three integer squares.
Let the tetrahedron have vertices at
\begin{eqnarray}
& (0,0,0)\\
& (a,0,0)\\
& (0,b,0)\\
& (0,0,c)
\end{eqnarray}
If $a,b,c$ are integers, at least two of which are even,
then the squared areas of the three triangles incident to the origin
are each integer squares, and so "represent" $n=A^2$, the diagonal-face area squared.
Example.
Let $a,b,c$ be $2,3,4$ respectively.

                   


The diagonal face-area squared is
\begin{eqnarray}
A^2 & = & \left[ (2 \cdot 3)^2 + (3 \cdot 4)^2 + (4 \cdot 2)^2 \right] \,/\, 4\\
& = & (36 + 144 +64) \,/\, 4 \\
& = & 9 + 36 + 16\\
& = & 61\\
A & = & \sqrt{61} \;.
\end{eqnarray}
So here, $61$ is represented as the sum of three squares: $9+36+16$.
Let $N_T(n)$ be the number of integers $\le n$ that can be represented
as a sum of three squares derived from deGua's tetrahedron theorem,
as above. Call these tetra-realized.
Let $N_L(n)$ be the number of integers $\le n$ that can be represented
as a sum of three squares.
$N_L$ is determined by
Legendre's three-square theorem, which
says that $n$ is the sum of three squares except when it is
of the form $n=4^a (8 b + 7)$, $a,b \in \mathbb{N}$.
I would like to know how prevalent is tetra-realization:

Q. What is the ratio of $N_T(n)$ to $N_L(n)$ as $n \to \infty$?

I would also be interested in any characterization of the tetra-realizable
$n$.

REPLY [17 votes]: These numbers are not very prevalent and the ratio in question goes to zero.  Note first that by Legendre's theorem, a positive proportion of the numbers below $n$ may be expressed as a sum of three squares.  Now consider $N_T(n)$.   This amounts to counting (with parity restrictions on $x$, $y$, $z$, and all three positive) the number of distinct integers of the form $((xy)^2 + (yz)^2 +(xz)^2)/4$ lying below $n$. So we must have $xy$, $yz$, and $xz$ all lying below $2\sqrt{n}$, which means that 
$$ 
xyz = \sqrt{(xy) (yz)(xz)} \le 2\sqrt{2} n^{\frac{3}{4}}.
$$ 
So the total number of possibilities for $(x,y,z)$ is bounded by the number of triples with product at most $X=2\sqrt{2}n^{\frac 34}$, and this is 
$$ 
 \sum_{xyz\le X} 1 \le \sum_{x,y\le X} \frac{X}{xy} \le X(1+\log X)^2.
$$
Thus, even if these choices for $(x,y,z)$ all led to distinct integers of 
the form $(xy)^2+(yz)^2+(xz)^2$, we still would have no more than $Cn^{\frac 34}(\log n)^2$ integers up to $n$ that may be tetra-realized.