Are there prime lengths in triangle with all integer sides and heights?

Solution 1:

No, none of the lengths can be prime.

Let me write $d,e,f$ for $h_a,h_b,h_c$, then twice the area is $$ 2\mathrm{Area} = ad=be=cf $$

triangle

Furthermore let $c=x+y$ with $x,y$ possibly signed lengths satisfying $x^2+f^2=a^2$ and $y^2+f^2=b^2$, so $x,y$ are (possibly signed) integers.

Consider the case in which a side length is prime, wlog let it be $c$.

Then since $c>d$, $c\nmid d$, but $c\mid ad$ so we must have $a=tc$, and similarly $c>e$ so $b=uc$ for integers $t,u$. Since $a,b,c$ make a triangle $a<b+c$ and $b<a+c$ we have $t<u+1,u<t+1\implies t=u$ and the triangle must be isosceles with $a=b$.

Then $x=y=c/2$, but $a^2=f^2+x^2$ requires $x$ to be an integer, so $c$ is even and can only be prime if $c=2$. But then $a^2=f^2+1$ which is impossible for positive integers $a,f$, so there cannot be such a triangle with a prime side.

Consider the case in which a height is prime, wlog let it be $f$.

If $f\mid a$ then $f\mid x$ and $(x/f)^2+1=(a/f)^2$ which is impossible for nonzero integers $x/f,a/f$. So $f\nmid a$ and $f\mid ad \implies d=tf$. Similarly $f\nmid b$ and so $e=uf$. Then from $ad=be=cf$ we have $c=ta=ub$. Wlog $a\ge b$, then from $c<a+b$ we have $(t-1)a<b \implies t=1$ and the triangle must be isosceles with $a=c$.

Then with $c=ub,e=uf$ and by symmetry the altitude bisecting $b$ $$ (b/2)^2+e^2=c^2 \\ (b/2)^2+u^2f^2=u^2b^2 \\ f^2=\left(\frac{b}{2u}\right)^2(4u^2-1) $$ Since $f$ is an integer and $\gcd(2u,4u^2-1)=1$ we must have $2u\mid b$. Since we have already shown $f\nmid b$ and by assumption $f$ is prime, then $\gcd(f,b)=1$ and we must have $b/2u=1$. Then $f^2=4u^2-1$, but this is impossible for positive integers $u,f$, so there cannot be such a triangle with prime height.