You are viewing a single comment's thread. Return to all comments →
def pythagoreanTriple(a): if a % 2 != 0: b = (a*a - 1) // 2 c = b + 1 else: m = a // 2 b = m*m - 1 c = m*m + 1 return a, b, c
Seems like cookies are disabled on this browser, please enable them to open this website
Pythagorean Triple
You are viewing a single comment's thread. Return to all comments →