# Number Theory/Pythagorean Triples

Suppose a^{2} + b^{2} = c^{2} 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), 1^{2} = 1 (mod 4), and 3^{2} = 9 = 1 (mod 4). Now any two odd numbers, “a” and “b”, have the following property a^{2} + b^{2} = 2 (mod 4), but this cannot be of the form “c^{2} ” 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 c^{2} = 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 (a^{2} + b^{2} = c^{2}) 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) a^{2} + b^{2} = (b + x)^{2} a^{2} = 2bx + x^{2} or a^{2} = x(2b + x)

gcd(x,2b + x)=1 because for any prime p (because x is odd, p cannot be 2) where p x, => p a^{2} => p a, and p (2b + x) because if p (2b + x) => p 2b => p b, but gcd(a,b)=1 so p (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 = i^{2} and (2b + x) =j^{2} reveals that a = ij then substituting to find b gives (2b + i^{2}) =j^{2} so b = (j^{2} - i^{2})/2 substituting to find c gives c = (j^{2} - i^{2})/2 + i^{2} = (j^{2} + i^{2})/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 , (j^{2} - i^{2})/2 , (j^{2} + i^{2})/2) = (a,b,c) where a^{2} + b^{2} = c^{2}