6
$\begingroup$

Given a positive integer, how can we determine if it is the hypotenuse of a right triangle with integer side lengths?

For example:

$5$ it can be hypotenuse as its other sides $3$ & $4$ are integers.

$13$ it can also hypotenuse as its other sides $12$ & $5$ are integers.

$12$ can't be hypotenuse because other two sides can't be integers.

$\endgroup$

2 Answers 2

7
$\begingroup$

An integer number $N>0$ can be the hypothenuse of a right angled triangle with integer side lengths if and only if it has a prime factor $p \equiv 1 (4)$ (i.e. $p$ is of the form $4k+1$ with integer $k$).

The proof outline is as follows:

  • If $N^2 = a^2+b^2$ then $(kN)^2 = (ka)^2+(kb)^2$.
  • Any prime $p \equiv 1 (4)$ can be represented as $x^2+y^2$ with positive integers $x,y$ (Fermat's theorem on sums of two squares). And then $p^2 = (x^2+y^2)^2 = (x^2-y^2)^2 + (2xy)^2$
  • All other numbers only have the trivial representation $N^2 = N^2+0^2$ (see e.g. here), which does not form a triangle.
$\endgroup$
2
  • $\begingroup$ Thank You so much. Simple, Consise and to the point. $\endgroup$ Commented Oct 7, 2015 at 18:32
  • $\begingroup$ So this way we can tell if such triangle exists. but we still cannot say how many of them exist! For example for 65 there exist 4 such triangles that are: [16, 63, 65], [25, 60, 65], [33, 56, 65], [39, 52, 65] $\endgroup$
    – PouJa
    Commented Jul 9, 2022 at 15:18
1
$\begingroup$

It is known that any primitive pythagorean triple $a^2 + b^2 = c^2$ is on the form $$ (a, b, c) = (2uv, u^2 - v^2, u^2 + v^2) $$for some natural numbers $u>v$, so you basically have to check whether your hypotenuse can be written as the sum of two squares. To confirm your examples, $5 = 4 + 1$, and $13 = 9 + 4$, while $12$ is not the sum of two squares (you can't add your way to $12$ by using only two numbers from $\{1, 4, 9\}$).

If course, it's possible that your number could be the hypotenuse in some non-primitive triple. This happens if it has a divisor that can be written as the sum of two squares. For instance, if at least one of its prime factors are congruent to $1$ modulo $4$.

$\endgroup$
1
  • $\begingroup$ @coproc: my comment was in response to another comment that has since been deleted. So I have deleted it. $\endgroup$
    – TonyK
    Commented Jul 10, 2022 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .