# Right triangle where the perimeter = area*k

I was doodling on some piece of paper a problem that sprung into my mind. After a few minutes of resultless tries, I advanced to try to solve the problem using computer based means.

The problem stated is

Does a right angle triangle with integer sides such that $$P = A\cdot k \quad \quad \text{or} \quad \quad k\cdot P = A$$ where $(P , \ A , \ k )\in \mathbb{N}$ exist?

(Here P is the perimeter of the triangle. Sum of the sides. And A is the area of the triangle. a*b/2 in a triangle with a b c and c is the hypotenuse)

Obviously for the simple cases such triangles exists. For an example when

$A=2P \qquad$ the triangle $12,16,20$ works

$A=P \qquad \; \;$ the triangle $6,8,10$ works

$2A=P \qquad$ the triangle $3,4,5$ works

I tried solving this by hand, first for the special case where $2P=A$. This ended up giving me

$$\frac{a \cdot b}{2} = A$$

and

$$P = \frac{A}{2} = \frac{a \cdot b}{4} \qquad \text{also} \qquad P = a + b + c$$

So

$$\frac{ab}{4} = a + b + c$$

By knowing that this is a right angle this leads to the equation (Using the Pythagorean theorem)

$$a^2 + b^2 = c^2$$

Now we have two equations and three unknowns, which also needs to be integers! Sadly I was not able to continue from here. I have only learned how to solve linear Diophantine equations. Not a system of nonlinear Diophantine equations.

Just to restate my question below =)

Is there a right angle triangle with integer sides such that $$P = A\cdot k \quad \quad \text{or} \quad \quad k\cdot P = A$$ where $(P , \ A , \ k )\in \mathbb{N}$ ?

Regards, Werner

-

We have the following relations: $$P=a+b+c,\quad 2A=ab,\quad a^2+b^2=c^2$$

In fact, there is one more that is implicit: the triangle inequality $a+b>c$ (which follows from $a^2+b^2=c^2$). We wish to relate the first and second relations, and so after staring at the problem for a while we realize the correct course of action is to multiply $P$ by $a+b-c$ (the latter guaranteed to be positive by the triangle inequality). This gives:

\begin{align}P(a+b-c)&=(a+b+c)(a+b-c)=(a+b)^2-c^2\\ &=a^2+b^2+2ab-c^2=2ab=4A \end{align}

Hence in general for a right triangle we have $k=A/P=(a+b-c)/4$, so the question boils down to when the difference between the sum of the lengths of the legs and the length of the hypothenuse divides or is divisible by $4$, for a right triangle with integer side-lengths.

Here we actually need to generate pythagorean triples $(a,b,c)$ such that $a,b,c$ are integers and $a^2+b^2=c^2$; the wikipedia page here gives a good picture of Euclid's formula that I recommend thinking through. Euclid's formula is the following:

$$a=m^2-n^2,\quad b=2mn\quad c=m^2+n^2$$ for integers $m>n$.

Then the quantity $a+b-c$ is $m^2-n^2+2mn-m^2-n^2=2n(m-n)$, so $A/P=k=n(m-n)/2$. The options are now that either $2$ divides $n$ or $2$ divides $m-n$, so we either have $n=2d$ and $m=k/d+2d$ or $n=d$ and $m=2(k/d)+d$ for divisors $d$ of $k$.

(to get $P/A=k$ we need $2n(m-n)$ to divide $4$, so $n(m-n)$ must divide $2$, thus $n=1$, $m=2$, $n=1$, $m=3$, and $n=2$, $m=3$ are the only solutions, giving us $(3,4,5)$, $(8,6,10)$, $(5,12,13)$ with $k=2,1,2$ being the only possibilities).

-

There is a method of generating all of the Pythagorean triples, that goes back in principle at least to the time of Euclid. You may find the details in this Wikipedia article interesting.

As a brief summary, apart from the order that the two legs are listed, all Pythagorean triples $(x,y,z)$ have the shape $$x=\lambda(m^2-n^2),\qquad y=\lambda(2mn), \qquad z=\lambda(m^2+n^2),\qquad (\ast)$$ where $m$, $n$, and $\lambda$ are positive integers.

For a triangle as described in $(\ast)$, we have $P=\lambda(2m^2+2mn)$ and $A=\lambda^2mn(m^2-n^2)$. So your equations (i) $P=kA$ and (ii) $A=kP$ can be rewritten as

(i) $\lambda(2m^2+2mn)=k\lambda^2mn(m^2-n^2)$ and

(ii) $k\lambda(2m^2+2mn)=\lambda^2mn(m^2-n^2)$.

Equation (i) quickly collapses. Cancellation gives $k\lambda n(m-n)=2$, and the list of solutions is short. There are two possibilities, $k=2$ and $k=1$. If $k=2$, then $\lambda=1$ and $m=2$, $n=1$, which gives your example $(3,4,5)$. If $k=1$, then $\lambda=2$, $m=2$, $n=1$ or $\lambda=1$, $m=3$, $n=1$, or $\lambda=1$, $m=3$, $n=2$. We obtain the examples $(6,8,10)$ and $(5,12, 13)$. That's all.

Equation (ii) is more interesting. Cancellation gives $$\lambda n(m-n)=2k. \qquad(\ast\ast)$$ For any $k$, we can find a solution, for example by putting $\lambda=1$, $n=2k$, and $m=2k+1$. Or, less interestingly, we can put $\lambda=k$, $m=2$, $n=1$, which gives a scaled version of the familiar $3$-$4$-$5$ triangle.

For given $k$, we can find an explicit way to generate all solutions of $(\ast\ast)$, and to obtain a count of them. For any fixed $k$, there are only finitely many solutions. Roughly speaking, if $k$ has many divisors then there are many solutions, since we generate the solutions by looking at factors of $2k$.

-

If you choose positive integers $a$ and $b$, you can make a right triangle with sides
$a^2-b^2\text{, } 2ab \text{ and } a^2+b^2,$
and all right triangles can be found this way by varying the values of $a$ and $b$.

If we have such a triangle, its area is $$\frac{1}{2}(a^2-b^2)\times 2ab = ab(a^2-b^2)$$ and its perimeter is $$a^2-b^2 + 2ab + a^2+b^2 = 2a(a+b).$$

For the first part of your question we want to set $$ab(a^2-b^2)\times k = 2a(a+b).$$ We can write this as $$ab(a-b)(a+b) = 2a(a+b)$$ and then cancel the $a$ and the $(a+b)$ on each side (neither are zero so it's ok) and get $$b(a-b)k = 2\quad\text{, and finally}$$ $$k = \frac{2}{b(a-b)}.$$

We want $k$ to be an integer, so it can only be 1 or 2.
If $k=1$ , $b(a-b)$ must equal $2$ and this can happen in two ways: when $a=3\text{ and }b=2$, which produces the 5-12-13 triangle, and when $a=3$ and $b=1$, which produces the 6-8-10 triangle.
If $k=2$ , $b(a-b)$ must equal $1$ and the only way this can happen is when $a=2\text{ and }b=1$. These values of $a$ and $b$ produce the 3-4-5 triangle.

For the second part of your question we want to set $$ab(a^2-b^2) = 2a(a+b)\times k.$$ We can reduce this as before and arrive at $$k = \frac{b(a-b)}{2}.$$ There are lots of different values of $a$ and $b$ that make $k$ an integer.

-
Minor comment: Not all Pythagorean triangles can be found in this way. The smallest counterexample is $(9,12,15)$. –  André Nicolas Dec 10 '11 at 20:57

I'm pretty sure I have misunderstood your question. I thought you asked, and then answered "Does there exist a right-triangle whose perimeter is equal to the area scaled by some constant, where the area, perimeter and scalar are positive integers?"

Yes. You mentioned three of them in your original post. Existence is confirmed, question is answered.

Or are you actually asking something else?

-