A Pythagorean triple consists of three positive integers satisfying . It is primitive when their greatest common divisor is one. Reducing their square numbers modulo shows that at least one leg is divisible by ; reducing modulo shows that both legs cannot be odd.
A rooted ternary tree that generates every primitive Pythagorean triple from by three fixed linear transformations. Keeping a consistent leg convention gives each primitive triple once; multiplying its sides then supplies all nonprimitive triples.
A Pythagorean triple whose coordinates have greatest common divisor 1. Its two legs have opposite integer parity, and every Pythagorean triple is a unique positive integer multiple of a primitive Pythagorean triple up to the ordering of its legs.
The formulas , , give a Pythagorean triple for integers , because . They give a primitive Pythagorean triple exactly when are coprime and have opposite integer parity. Every primitive Pythagorean triple arises this way after possibly exchanging the legs; scaling gives the nonprimitive triples.
Every primitive Pythagorean triple, after exchanging its legs, has this form with , and opposite parity. Its area is . The factors are pairwise coprime, because are odd. Conversely these conditions give a primitive triple. The parametrization follows by factoring the relatively prime integers and when is the even leg.
