Solution to Problem 271


Correct solutions came from John Snyder, USA; Brian Bradie, USA; Jerome Cherry, Canada; Jean Moreau de Saint-Martin, France; Claudio Baiocchi, Italy; Ron Welch, USA; Bill Webb, USA; Kai Grinde Myrann, Norway; Philippe Fondanaiche, France; Allen Druze, USA.


There are 84,169 triangles in all. Of these, 501 are isosceles (but not equilateral) and 1 is equilateral, leaving 83,667 that are scalene.

Let the lengths of the sides be a, b and c. We avoid duplicates by ordering them a<=b<=c. The triangle inequality is now equivalent to c<a+b. To get the right perimeter, we need b=2007-a-c. Then a<=b means 2a+c<=2007, b<=c means a+2c>=2007, and c<a+b means 2c<2007.

We could simply count the triangles systematically. Note that 2007/3<=c<2007/2. For each value of c, the inequalities in the previous paragraph imply 2007-2c<=a<=(2007-c)/2. With a and c being integers, there are 1+2+4+5+7+8+...496+497+499+500+502 solutions. Grouping terms (500+1=499+2=497+4...), this works out to 502+334*501/2=84,169. When a hits either of its bounds the triangle is isosceles. This happens for every c for the lower bound and every odd c for the upper bound, a total of 502 times. One of these is when both bounds are hit, giving the equilateral triangle.

Claudio Baiocchi suggested an amusing alternative method of counting:
Each triangle corresponds to a lattice point (a point with integer coordinates) in the region of the (a,c)-plane satisfying our inequalities. This region is the triangle with vertices v1=(669,669), v2=(1,1003) and v3=(502,1003). The points on (v1,v2] -- the line from v1 to v2, excluding v1 and including v2 -- and (v1-v3] give isosceles triangles; the point v1 gives an equilateral triangle; the remaining points (on (v2,v3) and inside the region) give scalene triangles. It is easy to see that there are 334 lattice points on (v1,v2], 167 lattice points on (v1-v3] and 500 lattice points on (v2-v3). To find the number of lattice points inside the region, we use Pick's Theorem, which states that the area of a simple lattice polygon is one less than the sum of the number of lattice points in its interior and half the number of lattice points on its boundary. The number of interior lattice points is thus the area (501*334/2) plus 1 minus half the number of boundary lattice points (1+334+167+500), which works out to 83,167.

You are visitor number 995   to this page.
ã2007 Alberto L. Delgado