How to find the 3 Pythagorean triplets with only one number?


Given: Pythagorean triplets

To explain: Here we have to explain how to find Pythagorean triplets with only one number.

Solution:

If the number is odd:

Square the number (n) and then divide it by 2.

Take the integer that is immediately before and after that number  

i.e. $\left(\frac{n^{2}}{2} \ -\ 0.5\right)$ and $\left(\frac{n^{2}}{2} \ +\ 0.5\right)$.

Pythagorean triplet = n, $\left(\frac{n^{2}}{2} \ -\ 0.5\right)$ and $\left(\frac{n^{2}}{2} \ +\ 0.5\right)$.

Example:

Take number n = 3.

On squaring the number, we get 9.

Now take half of it: $\frac{9}{2}$ = 4.5

The integer immediately before 4.5 = 4

The integer immediately after 4.5 = 5

Therefore, the triplets are 3, 4 and 5.

If the number is even:  

Take the half of that number (n) and then square it.  

Pythagorean triplet = n, $\left(\frac{n}{2}\right)^{2} \ -\ 1$ and $\left(\frac{n}{2}\right)^{2} \ +\ 1$   



Example:

Take number n = 8

Half of n = 4.  

Pythagorean triplet = 8, (42 $-$ 1) and (42 $+$ 1) = 8, 15 and 17.

Tutorialspoint
Tutorialspoint

Simply Easy Learning

Updated on: 10-Oct-2022

92 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements