$\begingroup$

There is a right triangle with rational sides and are $p$ iff there exists a solution.

$$pq^2=a^4+4b^4=(a^2+2b^2+2ab)(a^2+2b^2-2ab)$$ Without loss of generality, choose $a$ odd and $a,b$ coprime, then $a^2+2b^2+2ab$ and $a^2+2b^2-2ab$ are also coprime and $p\equiv 1 \pmod 4$. Divide into two cases:

$a^2+2b^2+2ab=pk_1^2$, $a^2+2b^2-2ab=k_2^2$ $a^2+2b^2+2ab=k_1^2$, $a^2+2b^2-2ab=pk_2^2$

These are the same under the transformation $a\to-a$, so I can ignore the second. Changing $a\mapsto a+b$ the system becomes:

$$a^2+b^2=pk_1^2$$ $$(a-2b)^2+b^2=k_2^2$$

There is no solution for $p=17$, and none for $p=29,61,73,89$ with $a,b<10^5$.