a pythagorean triplet is a set of three integers a, b and c such that a2 + b2 = c2. given a limit, generate all pythagorean triples with values smaller than given limit. limit = 20
Answers
Answered by
0
A Pythagorean triplet is a set of three integers a, b and c such that
Now, we have to find the Pythagorean triples with values smaller than 20.
Let us consider three numbers say 3, 4 and 5
Now, consider
So, 3,4 and 5 forms a pair of Pythagorean triplet.
Now, consider three numbers as 5, 12 and 13
Hence, it is another pair of Pythagorean triplet.
Now, consider another set of three numbers as 8, 15 and 17
Consider
289 = 64 + 225
So, 289= 289
Therefore, it is also a pair of Pythagorean triplet.
Therefore, 3,4,5 and 5,12,13 and 8,5,17 are the pairs of Pythagorean triplets less than 20.
Similar questions