3

can anybody help me out to find all Pythagorean triplet when Hypotenuse is given? for example 10 is given i need (10,6,8) ,and not needed such triplet (10,24,26) as 10 is not Hypotenuse for this triplet!

Khatri
  • 141
  • I edited my answer to include more examples of matching side C. If you like them, if my answer served your needs, feel free to upvote or even check me correct. Whoever you check gets 25 points or reputation. – poetasis Apr 17 '19 at 19:38
  • The functions in my answer below generate only triplets where the $GCD(A,B,C)$ is the square of an odd number. This includes primitives where $GCD=1$ and those where the GCDs are factors of or equal to $(2n-1)^2$. For even numbers like your example $(6,8,10)$ or non-square odd multiples you can find a match or prove it does not exist by reducing the terms to their factors and using the most primitive form. For example, your example is $2(3,4,5)$ and that happens to be $f(1,1)$ for my functions. If you wanted to find 234, it is 2117 and f(2,6)=(45,108,117) times $2=(90,216,234)$ etc. – poetasis Apr 19 '19 at 15:52
  • In your example (10,24,26) you have a $2X$ multiple of the primitive (5,12,13). If you use $n=1$ and $C_1=13$ in the $k$ function in my answer, you will find $k=2$. Then you have f(1,2)=(5,12,13) and, multiplying by $2$, you get back the (10,24,26) as the triplet you were looking for with a hypotenuse of $26$. I hope this is the correct answer to your question. – poetasis Apr 22 '19 at 17:52

2 Answers2

4

Euclid's formula generates all primitive triples, and this can be modified to give all triples: set $a = k\cdot(m^2 - n^2) ,\ \, b = k\cdot(2mn) ,\ \, c = k\cdot(m^2 + n^2)$, where $m, n$, and $k$ are positive integers with $m > n, m − n$ odd, and with $m$ and $n$ coprime. Then $a^2+b^2=c^2$, and $c$ is the given hypotenuse.

Dietrich Burde
  • 130,978
  • if c is hypotenuse will there exist only one pair (a,b) ? – Khatri Oct 14 '13 at 08:21
  • No, many pairs in general. For example $(16, 63, 65)$, $(33, 56, 65)$ etc. for $c=65$. – Dietrich Burde Oct 14 '13 at 08:24
  • and how to find m,n in your given explanation ? i mean if c is like c=k.p how will i know p is sum of two squares?(p=m^2+n^2) – Khatri Oct 14 '13 at 08:24
  • @Dheeraj For instance, if $c = 10$, then you can write it as either $1\cdot (3^2 + 1^2)$, $5\cdot (1^2 + 1^2)$ or $2\cdot(2^2 + 1^2)$. And then you check each one and see whether they are admissable. – Arthur Oct 14 '13 at 08:27
  • @ Dietrich Burde thank you this will help and sorry for not voting up as i have no enough reputation yet! – Khatri Oct 14 '13 at 08:36
  • @Arthur actually your answer is again involving my question as for case of 10 first of all i have to find all factors of 10 {1,2,5} now for each factor say 5 i have to check (10=5*2) whether 2 can be represented as square of two numbers that is nothing but mine question...?? – Khatri Oct 15 '13 at 19:36
2

You can use equations I created for a paper I am writing. To find a triplet with a matching $sideC$ for any odd number ($C_1$), set $$k_c=\frac{-(2n-1)+\sqrt{2C_1-(2n-1)^2}}{2}$$

Now try values of $n$ from $1$ up to $(m-1)$ where $4m^2+1>C_1$. Then, for any value of $n$ that yields a positive integer for $k$, you have a triplet with a matching $sideC$. If you do not find such an integer for $k$ using values of $n$ between $1$ and $(m-1)$, then there is no matching side.

If you do find a positive integer for $k$ for some value of $n$, then you can find the triplet sides A,B,C using the following functions:

$$A(n,k)=(2n-1)^2+2(2n-1)k$$ $$B(n,k)=2(2n-1)k+2k^2$$ $$C(n,k)=(2n-1)^2+2(2n-1)k+2k^2$$

Examples: If you want to find a triplet where $C_1=125$, you will find for $k(n)$ that $k(3)=5$ and $k(5)=2$ and that means that plugging $(3,5)$ and $(5,2)$ into the A.B.C equations will yield triplets with $sideC=125$, i.e. $75,100,125$ and $117,44,125$, respectively. Here are more examples I found in the spreadsheet I used for my study of matching values of $C$ where $f(n,k)$ is the triplet generated using the functions above: $$f(1,11)=(23,264,265), f(7,3)=(247,96,265) $$ $$f(1,13)=(21,220,221), f(5,5)=(171,140,221) $$ $$f(1,21)=(43,924,925), f(7,14)=(533,756,925) $$ $$f(1,28)=(57,1624,1625), f(8,20)=(825,1400,1625)$$ $$f(2,19)=(123,836,845), f(7,13)=(507,676,845) $$ $$f(2,26)=(165,1508,1517), f(8,19)=(795,1292,1517)$$ $$f(3,16=(185,672,697), F(7,11)=(455,528,697) $$ $$f(3,23)=(255,1288,1313), F(8,17)=(735,1088,1313)$$ $$f(4,19)=(315,988,1037), f(8,14)=(645,812,1037)$$ $$f(5,14)=(333,644,725), f(8,10)=(525,500,725)$$ If you go into the higher sets you will find more and more matching triplets in the lower sets $$f(1,23)=(47,1105,1105), f(10,12)=(817,744,1105) , f(15,4)=(1073,264,1105)$$ $$f(1,36)=(73,2664,2665), f(9,27)=(1207,2376,2665), f(15,19)=(1943,1824,2665)$$ $$f(7,23)=(767,1656,1825), f(13,15)=(1375,1200,1825), f(15,12)=(1537,904,1825)$$

poetasis
  • 6,338
  • @Khatri If you solve $A(n,k)$ and $B(n,k)$ for $k$ as I did for $C(n,k)$, you can also find matching sides for $A$ and $B$. BTW, you can always find a match for any $odd$ side by setting $n=1$ for $k_a$. This is because $n$ defines distinct sets of triplets and $Set_1$ contains every odd number >1 for side_A. – poetasis Mar 11 '19 at 16:29