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.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


[1] Wikipedia. "Coprime Integers." (Sep 26, 2012)
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.