Math, asked by sandra2967, 1 year ago

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 pinquancaro
0

A Pythagorean triplet is a set of three integers a, b and c such that a^2+b^2 = c^2

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

5^2 = 3^2 + 4^2

25 = 9+16

25 = 25

So, 3,4 and 5 forms a pair of Pythagorean triplet.

Now, consider three numbers as 5, 12 and 13

13^2 = 5^2 + 12^2

169 = 25 + 144

169 = 169

Hence, it is another pair of Pythagorean triplet.

Now, consider another set of three numbers as 8, 15 and 17

Consider 17^2 = 8^2 + 15^2

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