Primitive Pythagorean Triples 3: Ordered Tree Graph

Primitive Pythagorean triples (PPTs) can be ordered, as shown here by assigning a unique integer to each instance. In practice, this allows a collection of PPTs to be generated and selected by a slider. Use the "set" control in conjunction with the "value" slider to jump to points in the ordering corresponding to a PPT with the first coordinate , second coordinate , or ID number in base 3 equal to the selected value in base 10.



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


Let be a PPT, that is, , , and are positive integers such that with . A primitive right triangle has side lengths that form a PPT.
There are two ways to represent a particular PPT, by or }. The corresponding primitive right triangles are inversely similar.
Each PPT can be represented by a unique base-3 number, called the PPT's ID number. The three children of a PPT have ID numbers formed by appending 0, 1, or 2 to the ID number of the PPT. The parent of a PPT has an ID number formed by dropping the last digit of the PPT's ID number.
The Demonstration shows three levels of the PPT tree from a parent: the parent, three children, and nine grandchildren.
PPTs ordered in this manner form a pair of infinite ternary trees that are rooted and ordered. The two roots are and . The root of the tree to which any PPT belongs is identified by the first digit of its ID number. Only one tree is needed if inverse symmetry is ignored.
If is a child of the PPT , , , and ', this can be used to prove completeness, that is, that all PPTs are in the tree.
The Demonstration "Primitive Pythagorean Triples 2: Ordered Pairs" proves uniqueness, that is, that the PPTs in the tree are all different.
Suppose the ID number of a PPT is . Then the ID number for the inversely similar PPT is found by switching 1 and 2 in . For example, {975, 448, 1073} and {448, 975, 1073} have ID numbers 11201 and 22102.
[1] A. Hall, "Genealogy of Pythagorean Triads," Mathematical Gazette, LIV(390), 1970 pp. 377–379.
    • 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.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+