Equilateral Triangle With Lattice Points

Geometry Level 5

There are 27 points, and their coordinates are ( x , y , z ) (x,y,z) , where x , y , z -1,0,1 x,y,z\in\text{{-1,0,1}}

I choose 3 points from them, and they form an equilateral triangle.

How many equilateral triangles can be formed like this?


Bonus: This is the 3 × 3 × 3 3\times3\times3 case. Generalize the n × n × n n\times n\times n case.


The answer is 80.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Generate the lattice points.

p = Flatten [ Table [ { x , y , z } , { x , 1 , 1 } , { y , 1 , 1 } , { z , 1 , 1 } ] , 2 ] ; p=\text{Flatten}[\text{Table}[\{x,y,z\},\{x,-1,1\},\{y,-1,1\},\{z,-1,1\}],2];

Generate the triangles.

t = Flatten [ Table [ { p [ [ i ] ] , p [ [ j ] ] , p [ [ k ] ] } , { i , 1 , Length [ p ] } , { j , i + 1 , Length [ p ] } , { k , j + 1 , Length [ p ] } ] , 2 ] ; t=\text{Flatten}[\text{Table}[\{p[[i]],p[[j]],p[[k]]\},\{i,1,\text{Length}[p]\},\{j,i+1,\text{Length}[p]\},\{k,j+1,\text{Length}[p]\}],2];

Write a test for a triangle being equilateral.

equilateralQ = SquaredEuclideanDistance [ $#$1 [ [ 1 ] ] , $#$1 [ [ 2 ] ] ] = SquaredEuclideanDistance [ $#$1 [ [ 1 ] ] , $#$1 [ [ 3 ] ] ] SquaredEuclideanDistance [ $#$1 [ [ 1 ] ] , $#$1 [ [ 2 ] ] ] = SquaredEuclideanDistance [ $#$1 [ [ 2 ] ] , $#$1 [ [ 3 ] ] ] & ; \text{equilateralQ}= \\ \ \ \text{SquaredEuclideanDistance}[\text{\$\#\$1}[[1]],\text{\$\#\$1}[[2]]]=\text{SquaredEuclideanDistance}[\text{\$\#\$1}[[1]],\text{\$\#\$1}[[3]]]\land \\ \ \ \ \ \text{SquaredEuclideanDistance}[\text{\$\#\$1}[[1]],\text{\$\#\$1}[[2]]]=\text{SquaredEuclideanDistance}[\text{\$\#\$1}[[2]],\text{\$\#\$1}[[3]]]\&;

Apply test triangles and count the successful cases.

Length [ Select [ t , equilateralQ ( $#$1 ) & ] ] 80 \text{Length}[\text{Select}[t,\text{equilateralQ}(\text{\$\#\$1})\&]] \Longrightarrow 80

No overt recursion was required. This could have been done in most computer languages.

I can only find, 64 ( 2 ) \sqrt(2) triangles, and 8 2 ( 2 ) 2 \sqrt(2) sized ones, what am I missing?

Alex Burgess - 2 years, 1 month ago

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...