Let $S$ be the [set](https://artofproblemsolving.com/wiki/index.php/Set) of all [points](https://artofproblemsolving.com/wiki/index.php/Point) with [coordinates](https://artofproblemsolving.com/wiki/index.php/Coordinate) $(x,y,z)$, where $x$, $y$, and $z$ are each chosen from the set $\{0,1,2\}$. How many [equilateral](https://artofproblemsolving.com/wiki/index.php/Equilateral) [triangles](https://artofproblemsolving.com/wiki/index.php/Triangle) all have their [vertices](https://artofproblemsolving.com/wiki/index.php/Vertices) in $S$?
$(\mathrm {A}) \ 72\qquad (\mathrm {B}) \ 76 \qquad (\mathrm {C})\ 80 \qquad (\mathrm {D}) \ 84 \qquad (\mathrm {E})\ 88$
Solution 1 (non-rigorous)
For this solution, we will just find as many solutions as possible, until it becomes intuitive that there are no more size of triangles left.
First, try to make three of its vertices form an equilateral triangle. This we find is possible by taking any [vertex](https://artofproblemsolving.com/wiki/index.php/Vertex), and connecting the three adjacent vertices into a triangle. This triangle will have a side length of $\sqrt{2}$; a quick further examination of this cube will show us that this is the only possible side length (red triangle in diagram). Each of these triangles is determined by one vertex of the cube, so in one cube we have 8 equilateral triangles. We have 8 unit cubes, and then the entire cube (green triangle), giving us 9 cubes and $9 \cdot 8 = 72$ equilateral triangles. 





NOTE: Connecting the centers of the faces will actually give an [octahedron](https://artofproblemsolving.com/wiki/index.php/Octahedron), not a cube, because it only has $6$ vertices.
Now, we look for any additional equilateral triangles. Connecting the midpoints of three non-adjacent, non-parallel edges also gives us more equilateral triangles (blue triangle).  Notice that picking these three edges leaves two vertices alone (labelled A and B), and that picking any two opposite vertices determine two equilateral triangles. Hence there are $\frac{8 \cdot 2}{2} = 8$ of these equilateral triangles, for a total of $\boxed{\textbf{(C) }80}$.





Solution 2 (rigorous)
The three-dimensional [distance formula](https://artofproblemsolving.com/wiki/index.php/Distance_formula) shows that the lengths of the equilateral triangle must be $\sqrt{d_x^2 + d_y^2 + d_z^2}, 0 \le d_x, d_y, d_z \le 2$, which yields the possible edge lengths of

$\sqrt{0^2+0^2+1^2}=\sqrt{1},\ \sqrt{0^2+1^2+1^2}=\sqrt{2},\ \sqrt{1^2+1^2+1^2}=\sqrt{3},$ $\ \sqrt{0^2+0^2+2^2}=\sqrt{4},\ \sqrt{0^2+1^2+2^2}=\sqrt{5},\ \sqrt{1^2+1^2+2^2}=\sqrt{6},$ $\ \sqrt{0^2+2^2+2^2}=\sqrt{8},\ \sqrt{1^2+2^2+2^2}=\sqrt{9},\ \sqrt{2^2+2^2+2^2}=\sqrt{12}$
Some casework shows that $\sqrt{2},\ \sqrt{6},\ \sqrt{8}$ are the only lengths that work, from which we can use the same counting argument as above.