For every natural number m>1;2m,m²-1and m²+1 form a Pythagoras triplet. Write a program to input the value of'm' through console to display a Pythagoras triplet. Sample Input:3 . Then 2m=6,m²-1=8and m²+1=10. Thus 6,8,10 form a 'Pythagoras Triplet'. Java program only
Answers
Answered by
0
Answer:
Let a=m
2
−1
b=2m
c=m
2
+1
using pythagoras theorem, a
2
+b
2
=c
2
So, (m
2
−1)
2
+4m
2
=(m
2
+1)
2
m
4
+1−2m
2
+4m
2
=(m
2
+1)
2
m
4
+2m
2
+1=(m
2
+1)
2
(m
2
+1)
2
=(m
2
+1)
2
Since LHS=RHS , we can say that a,b,c always form pythagorean triplet
Similar questions