What is the greatest possible perimeter of a right-angled triangle with integer side lengths if one of the sides has length 12 ?

I know this question can be done in a variety of ways, the answer comes out to be $84$.

However, my friend and I were trying this question using QM$\ge$AM, and we didn't get $84$ through that, so I decided to ask here.

Let $x,y,z$ be the sides, and $x=12$.

We have:

$$\sqrt{\frac{x^2+y^2+z^2}{3}} \ge \frac{x+y+z}{3}$$

And $x,y,z$ are +ve because length can't be negative.

Since we want the maximum value the perimeter, the equality of the expression holds at $x=y=z$

plugging in the values, I get the maximum perimeter as $36$. Why am I getting the wrong answer solving this way?

I would be grateful if someone helped. Thanks.

  • 2
    $\begingroup$ $x=y=z$ gives you an equilateral triangle. Your question is about right triangle, that doesn't get addressed in your approach. $\endgroup$
    – Anurag A
    Commented Jul 19, 2021 at 2:45
  • $\begingroup$ Yes, you're right. Thanks, however using this inequality shouldn't we be getting the maximum perimeter in all possible cases (including all triangles)? $\endgroup$ Commented Jul 19, 2021 at 2:47
  • 1
    $\begingroup$ Your approach can't be right because if you scale up a $3$-$4$-$5$ right triangle by a factor of $4$, you get a perimeter of $48$. $\endgroup$ Commented Jul 19, 2021 at 2:48
  • 2
    $\begingroup$ @Mathematica The issue is that the inequality you are using is about three positive numbers $x,y,z$, whereas in your problem you want $x,y,z$ to be the sides of a triangle, so they are not just any numbers, they should satisfy constraints like triangle inequality etc. and that is why your approach won't yield the results. $\endgroup$
    – Anurag A
    Commented Jul 19, 2021 at 2:54
  • $\begingroup$ yeahh got it thankss $\endgroup$ Commented Jul 19, 2021 at 2:59

2 Answers 2


Alternative approach.

Either $(12)$ is the hypotenuse or it is one of the legs. The analysis below, which assumes that $(12)$ is one of the legs, will clearly show that setting $(12)$ as the hypotenuse will not maximize the perimeter.

Therefore, you have that $144 = (12)^2 = (x^2 - y^2) = (x + y)(x - y)$.

Here, it is desired to maximize $(x + y)$, so the possibility of $(x + y) = 144$ must be examined. This can be seen as impossible, because it requires that $x,y$ have the same odd/even parity, which makes it impossible for $(x - y)$ to equal $1$.

Therefore, the maximum value for $(x + y)$ is $72$, which requires that $(x - y) = 2.$ This is achieved via $(x,y) = (37,35).$

  • $\begingroup$ Just a quick note: $12$ cannot be the length of the hypotenuse because $12$ cannot be written as sum of squares of two integers. So that case can be ruled out easily. $\endgroup$
    – Anurag A
    Commented Jul 19, 2021 at 4:15
  • $\begingroup$ @AnuragA true, but requires some analysis to prove. My way, no such corresponding analysis is required, because it becomes irrelevant whether $(12)$ can be a hypotenuse. $\endgroup$ Commented Jul 19, 2021 at 4:18

Using Euclid algorithm. $a=2mn=12$, max possible with $m=6$ and $n=1$ gives $b=m^2-n^2=35$ and $c=m^2+n^2=37$ so perimeter $=84$.

  • $\begingroup$ Trying $b=m^2-n^2=12$ leads to $m=4$ and $n=2$ as the only possibility, making $a=2mn=16$ and $c=m^2+n^2=20$ for a total of $48 \lt 84$. $\endgroup$ Commented Jul 19, 2021 at 17:32
  • $\begingroup$ The Euclid algorithm does not generate all Pythagorean triangles. It produces all the primitive ones, but it will not produce $9,12,15$, for example. In this case it finds the one we want. $\endgroup$ Commented Oct 12, 2021 at 4:44

You must log in to answer this question.

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