Finding integer lengths for a right triangle with a given perimeter
You can improve the performance with a bit of math. Rather than doing this in \$O(p^3)\$ you can do it in in \$O(p)\$.

First remove \$c\$ from the equation:

$$
a + b + c = p\\
c = p - a - b\\
a^2 + b^2 = c^2\\
a^2 + b^2 = (a + b - p)^2$$

After this you can expand the right hand side and simplify.

$$
a^2 + b^2 = (a + b - p)(a + b - p)\\
a^2 + b^2 = a^2 + b^2 + 2ab - 2ap - 2bp + p^2\\
2ab - 2ap - 2bp + p^2 = 0\\
a = \frac{2bp - p^2}{2b - 2p}\\
$$

Which in Python can be:

def _right_a(p):
    for b in range(1, p // 2):
        a = (2*b*p - p**2) / (2 * (b - p))
        if a % 1:
            continue
        a = int(a)
        yield a, b, p - a - b


def int_right_tri(p):
    return {tuple(sorted(i)) for i in _right_a(p)}