Tag Archives: Pythagorean

Pythagorean triplet

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,  a2 + b2 = cFor example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000.  Find the product abc.

Simple approach a2 + b2 = (N-a-b)2   => a+b+c =N   i.e., a<b<c, From the condition a < b < c, we conclude that
a <= (s − 3) /3 and   b < (s − a)/2.

Using a parametrization of Pythagorean triplets

A Pythagorean triplet (a, b, c) is by definition primitive if gcd(a, b, c) = 1. Since for Pythagorean triplets one has gcd(a, b) = gcd(b, c) = gcd(c, a), such a triplet is primitive if and only if gcd(a, b) = 1. Read more of this post

Advertisement