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.
If $N$ is odd, use $(N^2-1)/2$ and $(N^2+1)/2$. If $N$ is even, use $N^2/4-1$ and $N^2/4+1$.