# Can we find two non-congruent right triangles with whole-number lengths and congruent hypotenuses?

I know some ways to find some Pythagorean triples.

And I understand that if $$a^2 + b^2 = c^2$$ then $$(a-b)^2 + (a+b)^2 = 2c^2$$.

I feel like that suggests a way forward, but I cannot find that way.

Is there an algorithm to pick four whole numbers to serve as the legs of two right triangles such that the triangles are not congruent but the hypotenuses are the same whole number?

Let $$(a_1,b_1,c_1)$$ and $$(a_2,b_2,c_2)$$ be arbitrary non-proportional pythagotrean triples, and let $$d:={\rm gcd}(c_1,c_2)$$. Then $${c_2\over d}\left(a_1,b_1,c_1\right),\qquad{c_1\over d}\left(a_2,b_2,c_2\right)$$ are pythagorean triples to noncongruent right triangles with the same hypotenuse $$c={c_1c_2\over d}$$.

• Awesome! It even works! Did you just work this out or did you already have it on hand? Jan 31, 2019 at 17:23
• @Chaim: I'm sorry, but this approach is more or less obvious. It would be more difficult to produce two primitive triples $(a_i,b_i, c)$. The above triples are not primitive. Jan 31, 2019 at 18:57

It is possible to find examples of two or more non-congruent right triangles with the same hypotenuse. I don't know of a systematic way to search for them (I used brute force). A few thoughts directed me to a choice of a hypotenuse to research: the hypotenuse of a primitive right triangle with integer sides must be odd; and that odd number may not have an odd number of prime factors congruent to $$3\mod(4)$$ if it can be represented as $$m^2+n^2$$. I chose to look at $$1105=5\cdot 13\cdot 17$$, which yielded the following three primitive Pythagorean triples: $$(1105,1104,47),\ (1105,1073,264),\ (1105,943,576)$$.

In the $$m^2-n^2,\ 2mn,\ m^2+n^2$$ representation of such triples, the first corresponds to $$m=24,\ n=23$$; the second to $$m=33,\ n=4$$; and the third to $$m=32,\ n=9$$.

Added by edit: Fermat proved that every prime number of the form $$4n+1$$ can be expressed as the sum of two squares in only one way. Primes of the form $$4n+3$$ cannot be expressed as the sum of two squares.

The Brahmagupta–Fibonacci identity says that $$(a^2 + b^2) (c^2 + d^2) = (a c − b d)^2 + (a d + b c)^2 = (a c + b d)^2 + (a d − b c)^2$$

This means that two suitable primes, each of which can be represented uniquely as the sum of two squares, have a product that can be represented in two distinct ways as the sum of two squares. Thus any odd number that is the product of two distinct primes, each of which has the form $$4n+1$$, can be the hypotenuse of two distinct primitive Pythagorean triples (as exemplified in the comment by David K). The inclusion of more suitable prime factors in the number corresponding to the hypotenuse will increase the number of ways that the resulting product can be represented as the sum of two squares (as exemplified in my earlier given example).

• I strongly suspect that you have in fact found a method that can be made systematic. You found three triangles because your hypotenuse had three prime factors congruent to $1$ mod $4$. What happens when you try adding $29$ as a factor? Is there a pattern you can guess, maybe prove? Feb 1, 2019 at 21:54
• @Ethan Bolker Perhaps the method can be made algorhithmic, but the numbers get so large so fast that it out paces my ability to calculate with access to a calculator only. I also bet you don't have to include every possible prime to find examples. Feb 1, 2019 at 21:57
• There are also the primitive triangles $(33,56,65)$ and $(16,63,65)$, which I think is the smallest such example. Feb 1, 2019 at 22:09
• @Keith Backman I do have a systematic way to find any matching triple sides by solving the equations of A,B,C (shown in my answer below) for $k$. My formula is original and gets downvoted all the time in MSE but it is the result of 10 years of research (part time) by a lowly fork lift mechanic (me) and it works wonders. See how matching sides is reason for my first question in this venue. May 22, 2019 at 1:07
• @Keith Backman I found . these in a spreadsheet using my method $$(47,1104,1105), (817,744,1105), (943,576,1105), (1073,264,1105)$$ May 22, 2019 at 1:51

You know Euclide's formula that gives all primitives pythagorean triples starting from two integers $$m>n>0$$, and this formula say that we can find only one value $$c=m^2+n^2$$. Non primitive triples can be found multiplying a primitive by an integer $$k$$ so, for any $$k$$ we have different triples and we conclude that we can have only one pythagorean triple for any $$c$$.

• I think that you are saying this: regardless of whether we limit ourselves to primitives, we cannot find two different triples with the same hypotenuse. Right? Jan 31, 2019 at 17:01
• @Emilio Novati You are wrong is saying there can be only one triple for any $c$. In my answer below, I showed how there can be dissimilar primitives with the same hypotenuse such as (13,84,85) and (77,36,85). It was easy with the functions I showed in my answer. May 22, 2019 at 0:25

We can find dissimilar triples with matching hypotenuse sides, if they exist, using the function below to find the right $$(m,n)$$ combinations for Euclid's formula:

$$n=\sqrt{C-m^2}$$ Whenever we get integer for $$n$$ and $$n then we have the $$(m,n)$$ needed to find a Pythagorean triple with a hypotenuse equal to $$C$$. The search is limited to where $$\mathbf {m=1\text{ to }\lfloor\sqrt{C}\rfloor}$$. For example, we want to find one or more triples with $$C=697$$. Then $$m_{max}=\lfloor\sqrt{697}\rfloor=26.$$

Trying different values where $$m=1\text{ to }26$$, we find $$(21,16)\text{ and }(24,11).$$

$$A=m^2-n^2\qquad B=2mn\qquad C=m^2+n^2$$ $$21^2-16^2=185\qquad2*21*16=672\qquad21^2+16^2=697$$ $$24^2-11^2=455\qquad2*24*11=528\qquad24^2+11^2=697$$ Sometimes there are no triples that match, such as if we find no integers in our search from $$1\text{ to } 26.$$ At other times there will be only one match or many such as in the example below.

$$(47,1104,1105)\quad(817,744,1105)\quad(943,576,1105)\quad(1073,264,1105)$$