as mentioned in video, the even term would be the 2mn term. But it doesnt always hold true when we are for eg 8
so the riplet would be 8 15 and 17. But this case is not covered. What to do for that?
Problem with pythagorian triplet as mentioned in this video regarding odd and even numbers
Aman, I think u are interpreting the solution incorrectly, basically when u have even value of n, then suppose you have two variables as p=n/2;
q=1;
then u may define 3 other variables as a, b and c where their values are determined as,
a=(p+q)*(p-q);
b=2*p*q;
c=(p*p)+(q*q);
So the output tht u will get will be a and c only.
You can code using the above approach and then u can check for the sample value as 8,
The output will come out to be 15 and 17 only.