# Are there any 2 primitive pythagorean triples who share a common leg?

So is it possible for:

$\gcd(a,b,c)=1$

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

and

$\gcd(a,d,e)=1$

$a^2+d^2=e^2$

?

• I thought it was common knowledge that $$3^2+4^2=5^2\qquad\text{and}\qquad5^2+12^2=13^2.$$ – Servaes Aug 15 '18 at 16:35
• Lol i forgot about that haha – Dean Yang Aug 15 '18 at 17:07

Any primitive Pythagorean triple can be expressed as $m^2-n^2, 2mn, m^2+n^2$ where $\gcd{m,n}=1$ and $m \not\equiv n \mod{2}$. For $m=ab, n=cd$ we can create two new quantities, $r=ac, s=bd$ such that $2mn=2rs$ and a primitive Pythagorean triple of the form $r^2-s^2, 2rs, r^2+s^2$ can be obtained which shares a common "leg" with the first triple.

Addendum: Due to the lateness of the hour, I only provided a partial answer given above to show that it was possible to answer the question in the affirmative. I glossed over a few items. Plainly $m>n$. But we must choose $(r,s)$ such that $r>s$. Accordingly, when we form $ac$ and $bd$, we must set $r$ equal to the larger of them. It will be noticed in passing that because one of $(m,n)$ and $(r,s)$ is even, that the even member of a primitive Pythagorean triple is divisible by $4$. Finally, I only demonstrated that in at least some cases, the even member of one primitive Pythagorean triple could appear in another. But not every even number can satisfy this condition. In particular, if $2mn=2^k$, then the only way to write factors that satisfy the general requirements is $m=2^{k-1},n=1$.

It is also usually the case that the odd member of one primitive Pythagorean triple can appear in another. One way to approach this is to factor $m^2-n^2$ into the odd factors $(m+n)(m-n)$ and examine those factors. But it is easier to employ the reasoning already presented to another formulation of primitive Pythagorean triples. $\frac{(m^2-n^2)}{2},mn,\frac{m^2+n^2}{2}$ is another formula that generates Pythagorean triples that are primitive when $\gcd{m,n}=1$ and $m \equiv n \equiv n \equiv 1 \mod{2}$. In this case, $mn$ is the smaller odd member of triple. As before, for $m=ab, n=cd$ we can create two new quantities, $r=ac, s=bd$ such that $mn=rs$ and a new primitive Pythagorean triple is obtained, with similar restrictions as apply in the former case. This shows that the smaller odd member of a Pythagorean triple in many instances can appear in more than one such triple. Note that if $mn=p^k$ then that particular odd number can only appear in a unique triple, analogous to the case of $2mn=2^k$ referred to above.

• Thanks for catching my omission; I have edited the answer to reflect that. – Keith Backman Aug 13 '18 at 1:53
• No problem! Another hint: try \pmod instead of \mod. :) – Théophile Aug 13 '18 at 1:53
• Example: (m,n)=(6,7) and (m',n')=(2,21) with Pyth. triples (84,13,85) and (84,437,445). – DanielWainfleet Aug 13 '18 at 18:10

This system of equations:

\left\{\begin{aligned}&a^2+b^2=c^2\\&z^2+b^2=x^2\end{aligned}\right.

Solutions have the form:

$$b=4tkp^2s^2$$

$$a=2(t^2-k^2)p^2s^2$$

$$z=4k^2s^4-t^2p^4$$

$$c=2(t^2+k^2)p^2s^2$$

$$x=4k^2s^4+t^2p^4$$

$t,k,p,s$ - integers asked us.