# Integer side length right triangles with area = perimeter

How many right triangles with integer side lengths (up to congruence) are there with the property that the area of the triangle is the same as the perimeter?

I found that $$5, 12, 13$$ has both an area and perimeter of 30 but I'm not sure if there are any more of them.

• $(6,8,10)$ is another. – Maryam May 26 '20 at 14:19
• thanks, is that the only other one? – qs13 May 26 '20 at 14:29

We are looking for $$a,b\in\mathbb N$$ such that $$ab = 2a+2b+2\sqrt{a^2+b^2}$$. After some manipulation, we have $$4a^2+4b^2=a^2b^2-4ab(a+b)+4a^2+8ab+4b^2$$$$a^2b^2-4ab(a+b-2)=0$$$$a^2b^2=4ab(a+b-2)$$$$ab=4(a+b-2)$$$$ab-4a-4b+16=8$$$$(a-4)(b-4)=8$$

So, there are only two possibilities as there are only two possible pairs of $$(a-4,b-4)$$: $$(1,8)$$ and $$(2,4)$$, which correspond to $$(5,12,13)$$ and $$(6,8,10)$$, respectively.

• There are actually infinetly many solutions to this system, of course if we add the fact that this MUST be pithagorean triplets, then we have only two cases – Samuel A. Morales May 26 '20 at 14:39
• @Samorales Look at the beginning of my answer, and the domain to which $a,b$ belong. – Don Thousand May 26 '20 at 14:41
• I did not pay attention to that, my bad. – Samuel A. Morales May 26 '20 at 14:42

The answer also falls directly out of the canonical formula for Pythagorean triples: $$x=m^2-n^2;\ y=2mn;\ z=m^2+n^2$$.

Accordingly, $$P=m^2-n^2+2mn+m^2+n^2=2m(m+n)$$ and $$A=\frac{1}{2}(m^2-n^2)(2mn)=mn(m+n)(m-n)$$

$$P=A \Rightarrow 2m(m+n)=mn(m+n)(m-n)$$. Removing identical factors, $$2=n(m-n)$$

Since $$2$$ is prime, the only solutions are $$m,n=3,1$$ and $$m,n=3,2$$, which yield the triples identified by the previous responders: $$(6,8,10)\ \text{and}\ (5,12,13)$$

To solve this question we need to go to the equations, notice that the area of a right triangle is denoted as:

$$\frac{a b}{2}$$ Where $$a$$ and $$b$$ are the legs of the triangle. On the other side, the perimeter of this triangle is $$a+b+c$$ Where $$c$$ is the hypotenuse of the same triangle. We can draw a relationship between c, a and b because by the pitagorean theorem we now that $$c=\sqrt{a^2+b^2}$$ and now we can group both equation with this last equality to have the following $$\frac{a b}{2}=a+b+c$$ $$\frac{a b}{2}=a+b+\sqrt{a^2+b^2}$$ After some basic algebraic manipulation we get the following expression

$$a=\frac{4 (b-2)}{b-4}$$ If we let $$b=5$$, then $$a=12$$ and by pithagorean theorem $$c=13$$

• You have to be a bit careful about dividing by expressions like $b-4$. – Don Thousand May 26 '20 at 14:33
• Sure, since this is a fractional expression, we can not use values suech as b=4 – Samuel A. Morales May 26 '20 at 14:37
• a has to be an integer, so you should consider when does b-4 divide 4, and when does it divide b-2. A quick think quickly eliminates all candidates for 4 as it is small, and in fact will give you the 2nd solution. Now can you prove from this that these are the only solutions? – Daniel Buck May 27 '20 at 16:32