# Generating All Coprime Pairs

Generating All Coprime Pairs

Two integers are said to be coprime (or relatively prime) if they do not share a common divisor different than 1. For instance, 4 and 9 are coprime (no common divisor except 1), but 12 and 15 are not (common divisor 3). The plot shows generations of coprime pairs , starting from and , where three new pairs are produced at each step: , , and . The resulting triplets can be arranged in two complete ternary trees. The procedure described here generates all coprime pairs without repetition; the colors represent the different generations.

(m,n)

(2,1)

(3,1)

(2m-n,m)

(2m+n,m)

(m+2n,n)