Module grscheller.boring_math.cli.pythag3

Entry point for the pythag3 cli script.

Functions

def pythag3_cli() ‑> None

Prints tuples of primitive Pythagorean triples.

  • Pythagorean triple are 3 integers a, b, c where a**2 + b**2 = c**2
  • such a triple is primitive when a, b, c > 0 and gcd(a, b, c) = 1
  • geometrically a, b, c represent the sides of a right triangle

Usage: pythag3 [m [n [max]]]

# of args Prints all possible triples (a, b, c) satisfying
3 m <= a <= n and a,b,c <= max
2 m <= a <= n
1 a <= m
0 3 <= a <= 100