in this whole lecture i am not understant any thing
Pythagorean Triplet Hint
@khemchandrs
Its quite simple really. A simple mathematical formula to obtain pythagorean triplets for a given integer N has been discussed with the mathematics involved behind it.
In short , the final formula that we obtain is
Let’s call the three sides of our triangle as a,b and c ( c being the hypotenuse )
If N is odd ,
a = N
b = ( N^2 -1) /2
c = ( N^2 +1)/2
If N is even
a = (N/2)^2 - 1
b = N
c = (N/2)^2 + 1
The mathematics behind obtaining this formula has been discussed in the video. This is the final result that we obtain. Use this formula to implement the code and obtain the required triplets.