Number of distinct right triangles formed by connecting vertices of a unit cube Suppose we have a unit cube in ${\mathbb{R}^3}.$

We want to count the total number of distinct right triangles formed by connecting vertices of the unit cube. I can see that the total number of right triangles simply on a face of the cube will be $4$ and since there are $6$ faces we have $4 \times 6 = 24$ right triangles on the faces alone. Of course there are others across the cube's diagonals. I think the total will be $48$, due a symmetry across the diagonals, but am not entirely sure of my reasoning here, so I may be wrong.
If someone could elucidate or provide a better/more rigorous answer it would be appreciated.
 A: You are correct in determining that there would be $48$ right triangles sharing at least one side with the cube. These can be counted as
$$\underbrace{4\times 6}_{\text{sharing 2 edges}} + \underbrace{2 \times 12}_{\text{sharing 1 edge}}=48$$
Observe that these are all the triangles any edge makes with six remaining vertices.
Now here is an argument that these are the only right triangles with vertices on the cube.
The distance between any two vertices of the cube belongs to the set $\{1,\sqrt{2}, \sqrt{3}\}$. This allows for right triangles only with sides $(1,1, \sqrt{2})$ and $(1,\sqrt{2}, \sqrt{3})$. That is, one of the sides of the right triangle must be $1$, an edge of the cube. And we have counted all of these. $ \qquad \square$
A: A key insight is that the only instance in which three vertices are selected that do not form a right triangle, is when those vertices form an equilateral triangle--i.e., no two vertices share an edge.
Since the cube circumscribes two distinct regular tetrahedra (cf. stella octangula), there are a total of $8$ such triangles.  Since there are a total of $$\binom{8}{3} = 56$$ ways to choose any three distinct vertices, and each choice corresponds to a unique triangle, the number of right triangles is $56 - 8 = 48$.
A: There are $\binom{8}{3}=56$ triangles in total, and the only non-right triangles are the equilateral triangles formed by the vertices exactly distance $1$ from a given vertex, and there are $8$ of these, so the answer is $56-8=48$.
