A phythagorean triangle is a triangle with a right angle. It is called a phythagorean triangle because the sides of the triangle obey the Phythagorean theorem. The square of the hypotenuse [ the longest side ] is the sum of the squares of the other two sides. A primitive triangle is a triangle where no two sides of the triangle have a factor in common. It's possible for two different phythagorean triangles to have the same perimeter. The smallest perimeter that has more than one phythagorean triangle with that perimeter is 1716. The following discusses the hunt for perimeters with a large number of primitive Phythagorean triangles with that perimeter. In this discussion we will almost always talk about the semi-perimeter instead of the perimeter. The semi-perimeter is half of the perimeter. Suppose x, y, z are the sides of a phythagorean triangle. Then the perimeter is x + y + z, and the semiperimeter is (x + y + z)/2. Let x < y < z. That is, z is the longest side. By the Phythagorean theorem, z^2 = x^ + y^2. y^2 = z^2 - x^2 = (z + x)(z - x) We wish to restrict our attention to primitive phythagorean triangles. That is, we wish to require that z and x have no factors in common. Below we establish some of the fundamental theorems that enable us to prove that if z and x have no factors in common, then (z+x) and (z-x) have no factors in common. Thus we can prove that z + x is a square, say A^2, and z - x is a square, say B^2. z = ( (z + x) + (z - x) )/2 = ( A^2 + B^2)/2 x = ( (z + x) - (z - x) )/2 = ( A^2 - B^2)/2 y^2 = (z + x) (z - x) = A^2 B^2 y = A B To simplify these formulas slightly, make the following transformation. Define A = m + n. Define B = m - n. Then z = (A^2 + B^2)/2 = ( (m+n)^2 + (m - n)^2 )/2 = ( m^2 + 2 m n + n^2 + m^2 - 2 m n + n^2)/2 = (2 m^2 + 2 n^2)/2 = m^2 + n^2. x = (A^2 - B^2)/2 = ( (m+n)^2 - (m-n)^2)/2 = ( (m^2 + 2 m n + n^2) - (m^2 - 2 m n + n^2))/2 = 4 m n /2 = 2 m n y = A B = (m+n)(m-n) = m^2 - n^2. The three sides of the triangle are (m^2-n^2),(2 m n),(m^2 + n^2). The perimeter of the triangle is (m^2 - n^2) + 2 m n + (m^2 + n^2) = 2 m^2 + 2 m n = 2 m (m + n). The semiperimeter is half of this. The semiperimeter of the triangle is m(m+n). So to find perimeters or semiperimeters belonging to a large number of different phythagorean triangles, we need only find those values of m(m+n) which can be factored in a large number of different ways. Notice also that since we wish to consider only primitive phythagorean triangles that the lengths of the 3 sides of the triangle, m^2 - n^2, 2 m n, and m^2 + n^2 must have no factors in common. Since 2 divides 2 m n, this means that both m^2 - n^2 and m^2 + n^2 must be odd. Since m^2 - n^2 = (m + n)(m-n) is odd, then both (m+n) and (m-n) must be odd. Since (m+n) is odd, this means that if the semiperimeter m(m+n) is odd, so is m, and if the semiperimeter m(m+n) is even, so is m. This is equivalent to saying that when m is even, n is odd, and when m is odd, n is even. The next few theorems establish some of the fundamental properties of prime numbers and enable us to say that any positive integer that is the semiperimeter of a primitive phythagorean triangle is of the form m (m+n) where m and n are relative prime, and m + n is odd. Theorem 1. Suppose a prime g divides b and also divides c. Then g divides the sum b+c. Proof: Apply the Distributive law of multiplication with respect to addition: Since g divides b, there exist a J such that b = J g. Since g divides c, there exist a K such that b = K g. b + c = J g + K g = (J+K)g Thus there exist (J + K) such that (J + K) g = (b = c). Conclude that g divides b + c. Theorem 1 tells us that whenever a prime g divides each of two numbers, then it also divides their sum. Note that sum can also mean difference since g divides a number n if and only if it also divides -n. Thus an instance of theorem 1 is, If the prime g divides b and g divides c, then it also divides their difference b - c. Application of theorem 1: If g divides (m^2 + n^2) and g divides (2 m n) then g divides (m^2 + 2 m n + n^2 ) = (m + n)^2. If g divides (m^2 + n^2) and g divides (2 m n) then g divides (m^2 - 2 m n + n^2) = (m - n)^2. Theorem 2. Let g be a prime. Suppose b and c are integers such that Suppose 0 < b < g and 0 < c < g. Then g does not divide bc. Proof: Suppose g did divide bc. Let bc = t g. Let s be the smallest positive integer such that s b is divisible by g. s is less than or equal to c since c b is divisible by g. Let s b = u g. Divide s into g to get quotient q and remainder r. g = s q + r where r is less than s. r = g - s q r b = (g - s q) b = g b - s q b = g b - s b q = g b - u g q = g b - g u q = g(b - u q) Thus r b is divisible by g. But s was supposed to be the smallest positive integer such that s b is divisible by g. This is a contradiction. Conclude that g cannot divide bc. Theorem 3. Let g be a prime. Suppose b and c are integers such that g does not divide b and g does not divide c. Then g does not divide bc. Proof: Divide g into b to get quotient d and remainder e. Divide g into c to get quotient h and remainder k. Then b = d g + e where 0 < e < g, c = h g + k where 0 < k < g. b c = (dg + e)(hg + k) = (dhg + eh + dk)g + ek Both e and k are positive integers less than g. By previous theorem, e k is not divisible by g. So b c cannot be divisible by g because if it were divisible by g, then bc - (dhg + eh + dk)g = ek would be divisible by g. But we have already shown that ek is not divisible by g. Theorem 4. If a prime g divides the product of two integers, b c, then g divides b or g divides c. Proof: Suppose g divided neither b nor c. Then by previous theorem, it could not divide bc. But g does divide bc. So it is false that g divides neither b nor c. g must divide at least one of b and c. Theorem 4 is summarized as: If a prime divides a product, then it must divide at least one of the factors. This is a fundamental property of prime numbers. Theorem 5. If the prime g divides n^2, then it must divide n Proof: By previous theorem if g divides n * n, then g must divide either n or n. That is, g must divide n. Application of theorem 5. If the prime g divides (m-n)^2 then g divides (m-n). If the prime g divides (m+n)^2 then g divides (m+n). Theorem 6. Let g be a prime number Let g be a common divisor of 2mn, (m+n)(m-n), m^2+n^2 where m,n are positive integers > 0. Let m+n be odd. Then g is an odd divisor of both m and n. Proof. g divides 2mn and g divides (m^2 + n^2). Therefore g divides their sum (m^2 + 2 m n + n^2), and their difference (m^2 - 2 m n + n^2). Thus g divides (m - n)^2 and g divides (m + n)^2. Thus g divides (m - n) and g divides (m + n). Thus g divides the sum (m + n) + (m - n) = 2m, and the difference ( m + n) - (m - n) = 2n. It is given that m + n is odd. Since g divides the odd integer (m + n), g cannot be even. The prime g must be odd g divides 2m and g divides 2n. Either g divides 2 or g divides m. Either g divides 2 or g divides n. g does not divide 2. g divides m and g divides n. Application of theorem 6: If m and n are relative prime, so are the triangle sides, m^2-n^2, 2 m n, and m^2 + n^2. For if the triangle sides were not relative prime, they would have a common prime divsor that would by theorem 6 also divide m and n. Thus we can be assured that if we look only at (m,n) pairs where m and n are relative prime, m+n is positive and both m and n are positive with m > n, then the phythagorean triangle generated by (m,n) has sides (m^2-n^2), (2 m n), (m^2 + n^2) that are relative prime in pairs. That is, the phythagorean triangle is a primitive phythagorean triangle. Theorem 7. Let (m,n) generate a primitive Phythagorean triangle with semi-perimeter m(m+n). Let p, q be odd positive integers such that p > q, p/q < (m+n)/m , and p and q are relative prime to m (m+n) and to each other, Then (p m , q(m+n) - p m) generates a primitive Phythagorean triangle with semi-perimeter m (m+n) p q. Theorem 8. Let (m,n) generate a primitive Phythagorean triangle with semi-perimeter m(m+n). Let p, q be odd positive integers such that p > q, p/q < 2 m /(m+n) , and p and q are relative prime to m (m+n) and to each other, Then (q m, p (m+n) - q m) generates a primitive Phythagorean triangle with semi-perimeter m (m+n) p q. Theorem 9. Define the even_part(m) = the largest power of 2 that divides m. Define the odd_part(m) = m/even_part(m). Let (m,n) generate a primitive Phythagorean triangle with semi-perimeter m(m+n). Let p, q be odd positive integers such that p > q, even_part(m)*(m+n)/odd_part(m) < p/q < 2 * even_part(m)*(m+n)/odd_part(m), and p and q are relative prime to m (m+n) and to each other, Then (even_part(m)*(m+n)*q, odd_part(m)*p - even_part(m) * (m+n)* q) ) generates a primitive Phythagorean triangle with semi-perimeter m (m+n) p q. Theorem 10. Let (m,n) generate a primitive Phythagorean triangle with semi-perimeter m(m+n). Let p, q be odd positive integers such that p > q, even_part(m)*(m+n)/odd_part(m) < p*q < 2 * even_part(m)*(m+n)/odd_part(m), and p and q are relative prime to m (m+n) and to each other, Then (even_part(m)*(m+n), odd_part(m)*p* q - even_part(m) * (m+n)) ) generates a primitive Phythagorean triangle with semi-perimeter m (m+n) p q. Theorem 11. If p and q are primes or powers of primes and p > q , and p and q are relative prime to m (m+n) and to each other, and m,n are positive relative prime integers with n < m, and m+n is odd, then the order of semiperimeter m (m+n) p q is the number of valid (m,n) pairs such that p/q < (m+n)/m plus the number of valid (m,n) pairs such that p/q < 2m/(m+n) plus the number of valid (m,n) pairs such that even_part(m)*(m+n)/odd_part(m) < p/q < 2 * even_part(m)*(m+n)/odd_part(m) plus the number of valid (m,n) pairs such that even_part(m)*(m+n)/odd_part(m) < p*q < 2 * even_part(m)*(m+n)/odd_part(m). By a valid (m,n) pair, I mean one for which 0 < n < m, m+n is odd and gcd(m,n) = 1. A N A L Y S I S O F S E M I P E R I M E T E R F A C T O R S If s is a positive integer, define ptso(s) = the number of primitive phythagorean triangles with semiperimeter equal to s. The letters ptso come from phythagorean semipermeter order. Suppose s = p1 p2 where p1 < p2 and p1 and p2 are relative prime, and each of p1, p2 is either a prime or a power of a prime. If p2 > 2 * p1 then ptso(s) = 0. If p2 is even, then ptso(s) = 0. If p1 < p2 < 2 * p1 and p2 is odd, then ptso(s) = 1. The minimum semiperimeter of two factors is p1 = 2, p2 = 3. Suppose s = p1 p2 p3 where p1 < p2 < p3 and p1, p2, p3 are pairwise relative prime, and each of p1, p2, p3 is either a prime or a power of a prime. If p3 > 2 p1 p2 then ptso(s) = 0. If p1 p2 < p3 < 2 p1 p2 and p3 is even, then ptso(s) = 0. If p1 p2 < p3 < 2 p1 p2 and p3 is odd, then ptso(s) = 1. Minimum semiperimeter of this form is p1 = 2, p2 = 3, p3 = 7. (m,n) = (6,1). Semiperimeter = 42. If p1 p2 /2 < p3 < p1 p2 and p1 p2 is even, the ptso(s) = 0. If p1 p2/2 < p3 < p1 p2 and p1 p2 is odd, then ptso(s) = 1. Minimum semiperimeter of this form is p1 = 3, p2 = 5, p3 = 8. (m,n) = (8,7). Semiperimeter = 120. If p3 < p1 p2/2 then ptso(s) = 0. Suppose s = p1 p2 p3 p4 where p1 < p2 < p3 < p4 and p1, p2, p3, p4 are pairwise relative prime, and each of p1, p2, p3, p4 is either a prime or a power of a prime. case m m+n (m+n)/m 00 1 p1 p2 p3 p4 > 2 01 p1 p2 p3 p4 > 2 02 p2 p1 p3 p4 > 2 03 p1 p2 p3 p4 p1 p2/p3 < p4 < 2 p1 p2/p3 04 p3 p1 p2 p4 >2 05 p1 p3 p2 p4 p1 p3 / p2 < p4 < 2 p1 p3 / p2 06 p2 p3 p1 p4 p2 p3 / p1 < p4 < 2 p2 p3 / p1 07 p1 p2 p3 p4 p1 p2 p3 < p4 < 2 p1 p2 p3 08 p4 p1 p2 p3 p1 p2 p3 /2 < p4 < p1 p2 p3 09 p1 p4 p2 p3 p2 p3 / (2 p1) < p4 < p2 p3 / p1 10 p2 p4 p1 p3 p1 p3 / (2 p2) < p4 < p1 p3 / p2 11 p1 p2 p4 p3 < 1 12 p3 p4 p1 p2 p1 p2 / (2 p3) < p4 < p1 p2 / p3 13 p1 p3 p4 p2 < 1 14 p2 p3 p4 p1 < 1 15 p1 p2 p3 p4 1 < 1 .5 p1 p2/p3 < .5 p1 p3/p2 < .5 p2 p3/p1 < p2 p3/p1 < 2 p2 p3/p1 < .5 p1 p2 p3 < p1 p2 p3 < 2 p1 p2 p3 Missing from this ordered sequence is p1 p2/p3, p1 p3/p2, 2 p1 p2/p3, and 2 p1 p3/p2 There are 3 possible places for p1 p2/p3. p1 p2 / p3 < .5 p1 p3/p2 .5 p1 p3/p2 < p1 p2/p3 < .5 p2 p3/p1 .5 p2 p3/p1 < p1 p2 / p3 Where p1 p2/p3 falls influences the number of primitive triangles that will have p1 p2 p3 p4 as a semiperimeter. With respect to the ordered sequence, there are two possible places for p1 p3/p2. p1 p3 / p2 < .5 p2 p3/p1 .5 p2 p3/p1 < p1 p3/p2 < p2 p3 / p1 With respect to the ordered sequence, there are 3 possible places for 2 p1 p2/p3. They are determined by where p1 p2/p3 falls. 2 p1 p2 / p3 < p1 p3/p2 p1 p3/p2 < 2 p1 p2/p3 < p2 p3/p1 p2 p3 /p1 < 2 p1 p2/p3 With respect to the ordered sequence, there are two possible places for 2 p1 p3 / p2. They are determined by where p1 p3/p2 falls. 2 p1 p3 / p2 < p2 p3/p1 p2 p3/p1 < 2 p1 p3 / p2 The placement of these 4 values in the ordered sequence influences the number of primitive triangles with semiperimeter p1 p2 p3. We can count exactly how many primitive triangles are generated when we place p4 in the ordered sequence. After we have placed these 4 into the ordered sequence, making a total of 12 values placed into the ordered sequence, there are 13 possible places for p4 to fall. This means that depending on the values of p1,p2,p3,p4 that there are 13 * 3 * 2 = 78 different possible sequences. We can examine all 78 sequences and calculate bounds on p3 and p4 in terms of p1 and p2 for each of the 78 different sequences. A special circumstance occurs if p1 = 2. In that case, 2 p2 p3/p1 is equal to .5 p1 p2 p3, and p4 cannot fall between them. In this case, p4 can fall in only 12 different places. Another consideration is that if the semiperimeter is even, then there are only 4 of the 12 values that will remain in the sequence. This is because the numerator must be odd for the middle 6 terms, and the denominator must be odd for the 3 terms with .5 as a multipler.