# Number Theory/Pythagorean Triples

Suppose a2 + b2 = c2 in integers, what do we know? Note that by multiplying each term by a constant a new solution exists (ma)2 + (mb)2 = (mc)2 So we may restrict our analysis to those (a,b,c) that have no common factors (we’ll call these triples “Primitive”). Also realize that it is sufficient that two of the numbers have no common factors, because if two have common factors then the third has the same factor in common as well. Since this is the case at least one of the legs is odd. Both “a” and “b” cannot be odd. First note that the square of any odd number is congruent to 1 (mod 4), verification, odd numbers are either congruent to 1 or 3 (mod 4), 12 = 1 (mod 4), and 32 = 9 = 1 (mod 4). Now any two odd numbers, “a” and “b”, have the following property a2 + b2 = 2 (mod 4), but this cannot be of the form “c2 ” because “c” would have to be even for the square to be even, and the square of an even number is divisible by 4, so c2 = 0 (mod 4), so in any primitive Pythagorean triple there one of the “legs” (“a” or “b”) must be odd, and the other must be even, forcing c to be odd always.

Conclusion: if (a,b,c) is a primitive triple (a2 + b2 = c2) then we may say that “a” is always odd, “b” is always even, and “c” is always odd, and gcd(a,b)=1

It would be nice if there were some sort of formula to generate all possible triples For this analysis a will be the odd leg, b will be the even leg and c the odd hypotenuse

c = b + x (note that x must be odd) a2 + b2 = (b + x)2 a2 = 2bx + x2 or a2 = x(2b + x)

gcd(x,2b + x)=1 because for any prime p (because x is odd, p cannot be 2) where p $\mid$ x, => p $\mid$ a2 => p $\mid$ a, and p $\nmid$ (2b + x) because if p $\mid$ (2b + x) => p $\mid$ 2b => p $\mid$ b, but gcd(a,b)=1 so p $\nmid$ (2b + x).

Knowing this, we see that both x and (2b + x) must be square numbers, and that they must be odd if we rename these squares x = i2 and (2b + x) =j2 reveals that a = ij then substituting to find b gives (2b + i2) =j2 so b = (j2 - i2)/2 substituting to find c gives c = (j2 - i2)/2 + i2 = (j2 + i2)/2 (note that i<j).

Conclusion: for any two odd numbers, with i<j and gcd(i,j) = 1, forms a pythagorean triple with the following form (ij , (j2 - i2)/2 , (j2 + i2)/2) = (a,b,c) where a2 + b2 = c2