Tree of primitive Pythagorean triples


In mathematics, a tree of primitive Pythagorean triples is a data tree in which each node branches to three subsequent nodes with the infinite set of all nodes giving all primitive Pythagorean triples without duplication.
A Pythagorean triple is a set of three positive integers a, b, and c having the property that they can be respectively the two legs and the hypotenuse of a right triangle, thus satisfying the equation ; the triple is said to be primitive if and only if the greatest common divisor of a, b, and c is one. Primitive Pythagorean triple a, b, and c are also pairwise coprime. The set of all primitive Pythagorean triples has the structure of a rooted tree, specifically a ternary tree, in a natural way. This was first discovered by B. Berggren in 1934.
F. J. M. Barning showed that when any of the three matrices
is multiplied on the right by a column vector whose components form a Pythagorean triple, then the result is another column vector whose components are a different Pythagorean triple. If the initial triple is primitive, then so is the one that results. Thus each primitive Pythagorean triple has three "children". All primitive Pythagorean triples are descended in this way from the triple , and no primitive triple appears more than once. The result may be graphically represented as an infinite ternary tree with at the root node. This tree also appeared in papers of A. Hall in 1970 and A. R. Kanga in 1990. In 2008 V. E. Firstov showed generally that only three such trichotomy trees exist and give explicitly a tree similar to Berggren's but starting with initial node.

Proofs

Presence of exclusively primitive Pythagorean triples

It can be shown inductively that the tree contains primitive Pythagorean triples and nothing else by showing that starting from a primitive Pythagorean triple, such as is present at the initial node with, each generated triple is both Pythagorean and primitive.

Preservation of the Pythagorean property

If any of the above matrices, say A, is applied to a triple T having the Pythagorean property a2+b2=c2 to obtain a new triple T = AT, this new triple is also Pythagorean. This can be seen by writing out each of d, e, and f as the sum of three terms in a, b, and c, squaring each of them, and substituting c2=a2+b2 to obtain f2=d2+e2. This holds for B and C as well as for A.

Preservation of primitivity

The matrices A, B, and C are all unimodular—that is, they have only integer entries and their determinants are ±1. Thus their inverses are also unimodular and in particular have only integer entries. So if any one of them, for example A, is applied to a primitive Pythagorean triple T to obtain another triple T, we have T = AT and hence T = A−1T. If any prime factor were shared by any two of d, e, and f then by this last equation that prime would also divide each of a, b, and c. So if a, b, and c are in fact pairwise coprime, then d, e, and f must be pairwise coprime as well. This holds for B and C as well as for A.

Presence of every primitive Pythagorean triple exactly once

To show that the tree contains every primitive Pythagorean triple, but no more than once, it suffices to show that for any such triple there is exactly one path back through the tree to the starting node. This can be seen by applying in turn each of the unimodular inverse matrices A−1, B−1, and C−1 to an arbitrary primitive Pythagorean triple, noting that by the above reasoning primitivity and the Pythagorean property are retained, and noting that for any triple larger than exactly one of the inverse transition matrices yields a new triple with all positive entries. By induction, this new valid triple itself leads to exactly one smaller valid triple, and so forth. By the finiteness of the number of smaller and smaller potential hypotenuses, eventually is reached. This proves that does in fact occur in the tree, since it can be reached from by reversing the steps; and it occurs uniquely because there was only one path from to.

Properties

The transformation using matrix A, if performed repeatedly from = , preserves the feature b + 1 = c; matrix B preserves ab = ±1 starting from ; and matrix C preserves the feature a + 2 = c starting from.
A geometric interpretation for this tree involves the excircles present at each node. The three children of any parent triangle “inherit” their inradii from the parent: the parent’s excircle radii become the inradii for the next generation. For example, parent has excircle radii equal to 2, 3 and 6. These are precisely the inradii of the three children, and respectively.
If either of A or C is applied repeatedly from any Pythagorean triple used as an initial condition, then the dynamics of any of a, b, and c can be expressed as the dynamics of x in
which is patterned on the matrices' shared characteristic equation
If B is applied repeatedly, then the dynamics of any of a, b, and c can be expressed as the dynamics of x in
which is patterned on the characteristic equation of B.
Moreover, an infinitude of other third-order univariate difference equations can be found by multiplying any of the three matrices together an arbitrary number of times in an arbitrary sequence. For instance, the matrix D = CB moves one out the tree by two nodes in a single step; the characteristic equation of D provides the pattern for the third-order dynamics of any of a, b, or c in the non-exhaustive tree formed by D.

Alternative methods of generating the tree

Another approach to the dynamics of this tree relies on the standard formula for generating all primitive Pythagorean triples:
with m > n > 0 and m and n coprime and of opposite parity. Pairs can be iterated by pre-multiplying them by any of
each of which preserves the inequalities, coprimeness, and opposite parity. The resulting ternary tree, starting at, contains every such pair exactly once, and when converted into triples it becomes identical to the tree described above.
Another way of using two underlying parameters to generate the tree of triples uses an alternative formula for all primitive triples:
with u > v > 0 and u and v coprime and both odd. Pairs can be iterated by pre-multiplying them by any of the above 2 × 2 matrices, all three of which preserve the inequalities, coprimeness, and the odd parity of both elements. When this process is begun at, the resulting ternary tree contains every such pair exactly once, and when converted into triples it becomes identical to the tree described above.

A different tree

Alternatively, one may also use 3 different matrices found by Price. These matrices A', B', C' and their corresponding linear transformations are shown below.
Price's three linear transformations are
The 3 children produced by each of the two sets of matrices are not the same, but each set separately produces all primitive triples.
For example, using as the parent, we get two sets of three children: