= Berggren tree
{c}
= Berggren's ternary tree
{c}
{synonym}
The <Berggren tree> is a <rooted tree> of <primitive Pythagorean triples>, with three children at every node. Fix the convention $a$ odd, $b$ even and $c>0$. Starting from the column <vector> $(3,4,5)^{\mathsf T}$, multiply by any of
$$
A=\begin{pmatrix}1&-2&2\\2&-1&2\\2&-2&3\end{pmatrix},\quad
B=\begin{pmatrix}1&2&2\\2&1&2\\2&2&3\end{pmatrix},\quad
C=\begin{pmatrix}-1&2&2\\-2&1&2\\-2&2&3\end{pmatrix}.
$$
The first children are $(5,12,13)$, $(21,20,29)$ and $(15,8,17)$. These <unimodular matrices> preserve the <quadratic form> $a^2+b^2-c^2$, <integer parity> and <greatest common divisor>. Every <primitive Pythagorean triple> occurs exactly once. <F. J. M. Barning>'s report gives this matrix-generation theorem with the even leg first.<Over Pythagorese en bijna-Pythagorese driehoeken en een generatieproces met behulp van unimodulaire matrices by F. J. M. Barning>[Section 1, printed pages 3–5]{ref}
An <infinite descent> argument explains completeness. Except at the root, the unique parent is
$$
\bigl(|a+2b-2c|,\ |2a+b-2c|,\ 3c-2a-2b\bigr).
$$
Its <hypotenuse> is positive and smaller than $c$, since $c<a+b\leq\sqrt2c$. The first two unmodified entries cannot both be negative; their signs select the inverse of $A$, $B$ or $C$. The odd entry cannot vanish; the even entry vanishes only at $(3,4,5)$. Repeated descent therefore reaches that root. Multiplying all three coordinates by a <positive integer> supplies every nonprimitive <Pythagorean triple>.
Back to article page