## The points $P(x_1, y_1)$ and $Q(x_2, y_2)$ are plotted at integer co-ordinates and are joined to the origin, $O(0,0)$, to form $\triangle OPQ$.

There are exactly fourteen triangles containing a right angle that can be formed when each co-ordinate lies between $0$ and $2$ inclusive; that is, $0 \le x_1, y_1, x_2, y_2 \le 2$.

Given that $0 \le x_1, y_1, x_2, y_2 \le 50$, how many right triangles can be formed?

### We’re asked how many right triangles can be formed between (x1, y1) and (x2, y2) such that x1, y1, x2, y2 are integers between 0 and 50 (including 0 and 50), and a vertex at the origin (O, 0,0).

Let’s first assess how many right triangles involving the origin (0,0), and a point on the x-axis (x, 0) and a point on the y-axis (0, y) would form. Since x and y values could range from 0 to 50, there would be 50* 50 = 2500 such right-angled triangles.

However, this will form only right-angled triangles which have one of the sides along the axes. We also have to consider cases where the right angle is at the origin but none of the sides lie along the axes.

For this, let’s take any point P (a, b) and draw a perpendicular to the x-axis, which meets the x-axis at Q(a, 0) and draw a line segment from P to the origin. Now, this will form a right-angled triangle if and only if there is a point on the y-axis such that its distance from the origin is same as the length of PQ. The length of PQ is simply the y-coordinate of P, which is b. So, for every point on the line with x-coordinate a, there exists a unique right-angled triangle that can be formed, whose hypotenuse starts at the origin and ends at the point P.

Since every line with a fixed x-coordinate has 50 such points (since 0<= b <= 50), and there are 51 such different lines (since 0<= a <= 50), the total number of right-angled triangles of this type is 50 * 51 = 2550 Since we counted right triangles which had the right angle at the origin and either one side along the axes (2500 cases) and neither side along the axes (2550 cases), we add these to get the total number of right triangles. Total number of right triangles is 2500 + 2550 = 5050. Thus, under the given conditions, a total of 5050 right-angled triangles can be formed.

##### More Answers:

Product-sum NumbersRoman Numerals

Cube Digit Pairs