Pythagorean triangle sides

Can all numbers $a, b, c$ that $a^2+b^2=c^2$ be sides of a right triangle? ($c$ is the hypotenuse) I saw this problem:

Find the number of right triangles that the hypotenuse and one side are both prime numbers.

I said that we don't have any property about the other side, so we can assume it is a real number and not only natural. Thus the sides would be $$p, \sqrt{q^2-p^2}, q$$ Where p and q are primes and q is the hypotenuse, and as result there exists infinte number of triangles of this type.

But what I am not sure about is that all these triples could be sides of a right triangle or not (being correct in triangle inequality). $$p<\sqrt{q^2-p^2}+q$$ And for other sides. Can all numbers all numbers in this form be sides of a right triangle or not (why)?

• Look up "primitive pythgorean triples". – quasi Mar 16 '17 at 7:06
• "Can all numbers a,b,c be sides of right triangles?" If they are all positive, Of course! You can always create a line that is a long. And you can always make a right angle. And you can always construct a line b long on that right angle. And you can always conect those line with a unique hypotenuse of length d. And it will always be true that $d^2=a^2+b^2=c^2$. As c and d are positive $d=c$. So this is a right triangle with sides a,b,c. – fleablood Mar 16 '17 at 7:35

Yes, if three side lengths satisfy the Pythagorean theorem, then they satisfy the triangle inequalities.

Proof: if $a^2+b^2=c^2$ and all letters denote positive numbers, $$a+b=\sqrt{(a+b)^2}=\sqrt{a^2+2ab+b^2}=\sqrt{c^2+2ab}>\sqrt{c^2}=c$$

Similarly

$$a+c=\sqrt{(a+c)^2}=\sqrt{a^2+2ac+c^2}=\sqrt{2a^2+2ac+b^2}>\sqrt{b^2}=b$$

Let $a,b$ be any three positive numbers so that $a^2+b^2=c^2$

You can always create a line segment of any (positive) length. So create one of length $a$. Call it $l_1$.

You can always construct an angle at any point of a line of any degree. So construct a right angle at the endpoint of $l_1$.

You can always extend a line or ray any distance. So extend the ray we created in second paragraph a distance of $b$. This creates a line segment. Call it $l_2$.

We can always connect two points with a unique line segment. So connect the opposite endpoints of $l_1$ and $l_2$.

We've just constructed a triangle. It is a right triangle because it has a right angle. It has a leg of length $a$ and another of length $b$.

By the pythagorean theorem the hypotenuse is of length so that $h^2=a^2+b^2=c^2$ so $h^2=c^2$. As $h$ and $c$ are both positive $h=c$.

So we've created just such a triangle asked.

That really was pretty obvious.

That said I strongly suspect you are misunderstanding the question as it is bizarrely trivial. I imagine the question was the hypotenuse was prime, a leg prome, and the second leg an integer.

So $a = \sqrt {p^2-q^2} \in \mathbb N; p, q$ prime. That is not quite so trivial. ($4,3,5$ is one. $12,5,13$ is another...)

.....

Oh, so as to triangle inequality:

$a + b = \sqrt {a^2+2ab+b^2}>\sqrt {a^2+b^2}=c$

$a+c > c =\sqrt {a^2+b^2}>\sqrt {b^2}=b$

$b+c > c =\sqrt {a^2+b^2}>\sqrt {a^2}=a$

so triangle inequality holds.

Or to put it in your terms. Is $p < \sqrt{q^2-p^2}+q$?

Yes. Let $c = \sqrt {q^2-p^2}$

$c^2 +p^2 = q^2$

$p^2 = q^2-c^2 < q^2$

So $p <q$ and $p <q +c$. (By quite a lot actually).

Is $c < p+q$?

Yes. $c = \sqrt {q^2-p^2}<\sqrt {q^2}=q <p+q$.

Is $q < p+c$ (this is the only really relevant case).

Yes. $q^2 = p^2 + c^2 < p^2+2pc+c^2=(p+c)^2$

So $q < p+c$.

If we try to solve this in integers, then Pythagorean triplets can all be generated like this :

$\begin{cases} u =r^2-s^2 \\ v = 2rs \\ w = r^2+s^2 \end{cases}$

Now since in your triangle $a,c$ are primes then since $2\mid v$ it is mandatory that $b=v$ (other solution is $(0,2,2)$ but that's not a proper triangle).

Also since the hypothenuse is the greater length, then $u=a$ and $w=c$.

But $a=r^2-s^2=(r-s)(r+s)$ is composed, unless $r-s=1$.

So let's have $r=s+1$.

$\begin{cases} a = 2s+1 \\ b = 2s(s+1) \\ c = s^2+2s+1+s^2=2s^2+2s+1=2s(s+1)+1=b+1 \end{cases}$

This gives $a^2=2b+1=b+c$

We arrive to a system like this $\begin{cases} a & \text{odd prime} \\ b = \frac{a^2-1}{2} \\ c = b+1 = \frac{a^2+1}{2} &\text{also odd prime} \end{cases}$

Here are the first triangles satisfying your requirement :

                           3, 4, 5
5, 12, 13
11, 60, 61
19, 180, 181
29, 420, 421
59, 1740, 1741
61, 1860, 1861
71, 2520, 2521
79, 3120, 3121
101, 5100, 5101


The question resumes to finding primes $p$ such that $\frac{p^2+1}2$ is also prime, but I have no clue about this one, I imagine there are an infinity of such $p$.