What is a pythagorean triplet?
A Pythagorean triplet is a set of three whole numbers, say A, B and C, such that A^2 + B^2 = C^2. They form the sides of a right-angled triangle. Here is how to construct an infinite number of such triplets. Take any two numbers P and Q, one of them even and the other one odd. Calculate the numbers A = P^2 – Q^2, B = 2 * P * Q, and C = P^2 + Q^2. You will find that in every possible case, A^2 + B^2 = C^2. If P and Q have no common factor, then neither will A, B and C, in which case they are called a PRIMITIVE Pythagorean triplet. Example 1: P = 6, Q = 11, A = 85, B = 132, C = 157, no common factor. Example 2: P = 6, Q = 15, A = 189, B = 180, C = 261, common factor 9.