How can i work out a pythagorean triple?
You can use Euclid’s formula for generating Pythagorean triples. Given an arbitrary pair of positive integers m and n with m > n. The formula states that the integers 2mn m² – n² m² + n² form a Pythagorean triple. So just pick a pair of positive integer values of m and n, and you’ll generate a Pythagorean triple. For example: m = 2, n = 1 2mn = 2(2)(1) = 4 m² + n² = 2² + 1² = 5 m² – n² = 2² – 1² = 3 (3, 4, 5) Or: m = 3, n = 2 2mn = 2(3)(2) = 12 m² + n² = 9 + 4 = 13 m² – n² = 5 (5, 12, 13) You can also take a known triple and just multiply all the numbers by a constant integer multiplier. For example, taking 3,4,5 you can double or triple to get: (3,4,5) –> (6,8,10) –> (9,12,15) Note: The triple generated by Euclid’s formula is primitive if and only if m and n are coprime (have no factors in common) and exactly one of them is even. So if you only want primitive triples, be sure to m and n accordingly.