And I decided today to share what I learned about an algorithm for generating Pythagorean triples for any and , where Z.

A Pythagorean triple are any three whole numbers which satisfy the equation . For any two integers and , let ; ; and , and you will obtain a solution to the relation .

It is therefore not that hard, if we allow and to be any numbers from 1 to any upper limit you like, to write a computer program to generate the first Pythagorean triples, allowing for negative values for or .