Can you find the legs of a Pythagorean triangle with its hypotenuse?

163 Views Asked by At

Pretty self explanatory, but I haven’t seen any papers on whether someone can find a and b, given c, such that $a^2 + b^2 = c^2$ and a,b, and c are integers. If there isn’t a way is their an approximation formula?

Clarity: I am looking for method to calculate a and b given c such that a,b,c are a Pythagorean triple.

Example: Find the a,b given c is a large number asy 2048 bits where factoring isn’t an option, without brute forcing. My question is how do you find a,b?

3

There are 3 best solutions below

7
On BEST ANSWER

Let's talk about the case where $a,b,c$ are co-prime first. Then we know that $\exists u,v (c=u^2+v^2).$ Also, once we can find $u,v$ we can find $a,b$. Furthermore, the sum of two squares theoremtells exactlt which integers can be expressed as the sum of two squares, so the problem is solved, provided $c$ is small enough to factor.

Then, of course, there's the question of finding all the different possibilities for $a$ and $b$, which comes down to counting the number of ways to express $c$ as the sum of two squares. You can find a discussion of that here .

Wolfram Alpha factors 158077286429 into three distinct primes, each of which is $\equiv 1 \pmod{4},$ so there is a solution. The first two primes in the factorization are $157$ and $769,$ so finding the representation as a sum of two squares can be done with a pencil. The third prime is $1,309,313$ and I imagine you'll need a computer; I know I would.

By the way, there's a theorem that the sum of two squares times the sum of two squares is again the sum of two squares, and there's a formula (or rather two) to get the representations.

Just for grins: $$\begin{align} 145807675179^2 + 61061856700^2 &= 158077286429^2 \\ 155253825771^2 + 29743538260^2 &= 158077286429^2 \\ 4741142229^2 + 158006170940^2 &= 158077286429^2 \\ 91317244821^2 + 129033287500^2 &= 158077286429^2 \end{align}$$

4
On

hint

Observe that

$$(x^2+y^2)^2=(x^2-y^2)^2+(2xy)^2$$

0
On

We can find triples for any given $C$, if they exist, by solving Euclid's formula function $C=f(m,n)$ for $n$ and testing a defined range of $m$-values to see which, if any, yield integers for $n$.

$$C=m^2+n^2\Rightarrow n=\sqrt{C-m^2}\qquad\qquad \biggl\lceil\sqrt{\frac{C}{2}}\biggr\rceil \le m < \sqrt{C}$$

In the case of $158077286429$,

$n=\sqrt{158077286429-m^2}\quad $where$\quad\biggl\lceil\sqrt{\frac{158077286429}{2}}\biggr\rceil=281139 \le m < \sqrt{158077286429}=397589$

This is quite a range to search and this formula will only find primitives, doubles, and square multiples of primitives so a better approach is to try the factors of $158077286429$ $(157 * 769 * 1309313)$and then multiply any primitives found by the cofactors.

For $157\quad 9\le m\le12\qquad\sqrt{157-11^2}=6\qquad F(11,6)=(85,132,157)$

For $769\quad 20\le m\le 27\qquad\sqrt{769-25^2}=12\qquad F(25,12)=(481,600,769)$

For $1309313\quad 809\le m\le 1144\qquad\sqrt{1309313-1132^2}=167\qquad F(1132,167)=(1253535,378088,1309313)$

For $157*769=120733\quad 246\le m\le347\qquad\sqrt{120733-282^2}=203\qquad F(282,203)=(38315,114492,120733)$

For $1309313*157=205562141\qquad 10139\le m\le 14337\qquad \\ \sqrt{205562141-11450^2}=8629\qquad F(11450,8629)=(56642859,197604100,205562141) \\ \sqrt{205562141-13454^2}=4955\qquad F(13454,4955)=(156458091,133329140,205562141)$

For $1309313*769=1006861697\qquad 22438\le m\le 31731\qquad \\ \sqrt{1006861697-26296^2}=17759\qquad F(26296,17759)=(376097535,933981328,1006861697) \\ \sqrt{1006861697-30304^2}=9409\qquad F(30304,9409)=(829803135,570260672,1006861697)$

If you multiply each of these $8$ triples by their corresponding cofactors of $C$ you will find unique triples where $C=158077286429$. These were found in a spreadsheet. With $110000$ values of $m$ to test, I would recommend a computer program to find out if there are primitives where $C=158077286429$.