Right Triangle with a Given Side


I got a variant of this problem from Rustan Leino, who came up with it after being inspired by a problem from Madan Musuvathi.

I solved it and wrote up my solution.


There's a simple technique that, given any integer $N > 2$, allows you to figure out the other two integer sides of a right triangle in your head (or with pen and paper if the numbers get too large). Find this technique.

Solution     Reveal