,
SHAHBAZKIA Hamid 0, and a third point (z,w) different from
these and from the origin. This appears to give n^2( (n+1)^2-3 ) triangles,
although if z or w is zero, we will create a triangle which will
be counted twice.
==============================================================================
[This next was also evidently neither posted nor mailed.
[Timestamp: 15 Nov 1995 08:53 CST]
==============================================================================
Now let us consider the equivalneece classes under the group Z^2.C_4
of translations and 90-degree rotations. There are several quantities
asociated with a triangle which are preserved under this group. One is
what I might call the _collection of inverse slopes_ of the three
sides: to a side of slope m we associate the number m if |m|<=1 and
1/m if |m|>1; vertical and horizontal lines are assigned the number 0.
Thus a triangle determines a set of three numbers {m1, m2, m3} each in
the interval [-1,1]; these numbers do not change upon translation and
90-degree rotation, that is, they are functions of equivalence classes.
Note that a non-degenerate triangle cannot have the collection be {0,0,0}.
It can have form {0,0,m} -- this happens iff there are two sides parallel to
the axes. In this case a unique rotation and translation will move their
intersection to the origin, so that the triangle is {(0,0), (a,0), (0,b)}
with a>0, b>0. Thus I count n^2 equivalence classes of form {0,0,m}.
If a triangle has form {0, m1, m2} then there is a unique rotation
which gives it a horizontal side "south" of the triangle. If the angle
to the left of this base is acute, there is a unique translation taking
the triangle to {(0,0), (a,0), (x,y)} where a, x, y > 0: n^3 triangles.
If instead the angle at the left is obtuse, rotate 90 degrees clockwise
and follow by the rotation taking the triangle to {(0,0), (0,a), (x,y)}
where a>0 and this time we must have x>0 and y>a. Summing over the
choices of a gives n^2(n-1)/2 more triangles.
If the triangle has form {m1, m2, m3} in which the m_i are not all of
the same sign, then there is a unique rotation making two of the m_i
positive and the triangle to the "northeast" of the intersection the
corresponding lines. Then a unique translation takes the triangle to
{(0,0), (x,y), (z,w)} where the negativity of the third slope means
(x-z)/(y-w)<0. To count these triangles, fix any (x,y) not on the left
or bottom edges to be the top-most point, and count the choices for
(z,w) to the southeast of it: there are (n-x)(y-1) such choices. This gives
n^2(n-1)^2/4 triangles.
Finally, if the triangle has form {m1, m2, m3} in which the m_i _are_
all of the same sign, then there are _two_ rotations making all the
m_i positive and the triangle to the "northeast" of the intersection
the corresponding lines. In this case we choose the one with the
longest side to the north. Then a unique translation takes the
triangle to {(0,0), (x,y), (z,w)} in which, if (x,y) is the
right-most point, we have x>z, y>w, and x/y > z/w. For any pair
(x,y) not on the left or bottom the choices for (z,w) are all those
strictly inside the triangle {(0,0), (x,y), (0,x)}. These are of course
half the points inside a rectangle, apart from the points on the perimeter
and the additional -1+gcd(x,y) points on the diagonal. Thus the total
number of such triangles is Sum( (1/2)((x-1)(y-1)+1-gcd(x,y), 0