<s>[INST] If $a^2 + p^2 = b^2$ then $2(a+p+1)$ is a perfect square We are given $$ a^2 + p^2 = b^2 $$ where $a,b\in\mathbb{Z}$ and $p$ is prime. We are to show that $$2(a+p+1)$$ is a perfect square. Is there any elegant ways to go about this problem? Struggling to find a proof myself. Thanks in advance.
 [/INST] We have $a^2 + p^2 = b^2$ so $p^2 = b^2-a^2 = (b+a)(b-a)$.
Therefore $b-a=1$ and $p^2 = b+a=2a+1$
Therefore $2(a+p+1) = p^2 + 2p + 1 = (p+1)^2$
</s>