Pythagorean Triple

  • + 0 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