We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Algebra
- Pythagorean Triple
- Discussions
Pythagorean Triple
Pythagorean Triple
Sort by
recency
|
31 Discussions
|
Please Login in order to post a comment
What's up? I've come to introduce you to coreball. They're a great option for individuals who want to work out in the comfort of their own homes. In addition, it is a viable alternative to providing your body with beneficial exercises while in quarantine. Try it out!
def pythagoreanTriple(a): if a%2 ==1 : n= (a-1)//2 m=n+1 else : if a % 4 == 0: m = a//4 + 1 n = a//4 -1 else : n=1 m=a//2 return [m**2-n**2,2*m*n,m**2+n**2]
Complete Java Solution