Contest Math Possible Triangles In the xy-plane, how many triangles have each of their vertices at points (a,b) where a,b are integers satisfying 1 ≤ a ≤ 5 and 1≤b≤5?
I got twenty-five, but something tells me this isn't right. I set up an inequality, square root of a squared plus b squared is less than a plus b but more than the absolute value of b minus a. Squaring, we can get rid of a squared plus b squared, leaving -2ab<0<2ab, which is always true. So, each pairing works, and we have five times five for twenty-five. 
I feel that the answer is way too simple. If it is indeed wrong, where did I go wrong?
 A: Focus on counting the ways to choose three collinear points.  If the line is horizontal or vertical, then there are $5\times{{5}\choose{3}}=50$ possibilities, for a total of $100$ ways.  If the slope of the line is $\pm 1$, then there are $9$ ways to place a segment containing three points, $4$ ways to place a segment containing four points (each with $2$ ways to choose the intermediate point), and one way to place a segment containing five points (with $3$ ways to choose the intermediate point), for a total of $40$ ways to choose the points with a slope of $\pm1$.  If the slope is $\pm 2$ or $\pm 1/2$, then there are just $3$ ways to place a segment containing three points, for a total of $12$ with these slopes.  In total there are $152$ ways to choose three collinear points.
Subtracting this from the total number of ways of choosing three points gives
$$
{{25}\choose{3}}-152=2300 - 152=2148
$$
distinct triangles.
A: It seems to me that it could be (25)(24)(20)/6.  You start with 25 points you can choose your first point from.  Then you pick any second point from any of the 24 remaining points.  Then you would pick from any of the remaining 23, but you could end up with a line that way.  Three  points could yield a line at that point, so you actually have 20 points to choose from.  But we've over-counted.  There are six ways to get any of those triangles, so we divide the (25)(24)(20) by six.  I'm not sure it's right, but you can check the general method with a 3x3 grid and see if it works for that.
