Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 5.3.1 (First Pythagorean triples)
Exercise 5.3.1 (First Pythagorean triples)
Find all primitive Pythagorean triples for which .
Answers
Proof. By Theorem 5.5, the positive primitive solutions of with even are
where are arbitrary integers of opposite parity with and .
If , then , thus , so
We obtain all the possibilities with this Python program:
from math import gcd, floor, sqrt max_z = 30 max_r = floor(sqrt(max_z)) for r in range(1, max_r + 1): for s in range(1, r): if gcd(r,s) == 1 and r % 2 != s % 2: if r * r + s * s < max_z: t = [r * r - s * s, 2 * r * s, r * r + s * s] print((r,s), ’=>’, t) (2, 1) => [3, 4, 5] (3, 2) => [5, 12, 13] (4, 1) => [15, 8, 17] (4, 3) => [7, 24, 25] (5, 2) => [21, 20, 29]
The positive primitive solutions of with even and are
and all positive primitive solutions are
(So all primitive Pythagorean triples for which are
□