# Heronian triangle with two sides that are prime

Can any prime number form a Heronian triangle with a second prime as another side? I cannot find a second prime to form a Heronian triangle with either 23 or 167. I have checked up to the 10^7th prime for both with no solution. Also if there is a solution for primes other than 23 or 167 to have a second prime as another side, is the solution set for that prime finite or infinite. See OEIS A230666 and A233232 for primes 3 and 5 where the solution sets are infinite.

• Can you add the algebraic (number-theoretic) requirement for sides b and c? It might result in an interesting Diophantine equation. Gerhard "Not Above Retasking A Question" Paseman, 2013.12.30 Commented Dec 30, 2013 at 21:58
• In particular, it smells like a Pell equation with a large fundamental solution, but I probably have the degree wrong. Gerhard "Doing This Off Of Memory" Paseman, 2013.12.30 Commented Dec 30, 2013 at 22:00

For $p=23$, one Heronian triangle with another prime side $q$ has $q = 5280071830550089$, with third side $q-1$ and area $60663406817631420 = 2^2 \, 3^4 \, 11 \; 23 \; 37^2 \, 47 \; 71 \; 179 \; 181$.
For each $p$ there are probably infinitely many examples but very sparse; for $p=167$ I didn't find one with a prime side among the first few dozen solutions (though there might be a few other variants to try). [Added later: an example is $q = 231781748893580717709514473745694370721$, for which the triangle with sides $167$, $q-25$, $q$ has area $19135685576510124949571252858502010748400$ $$= 2^4 \, 3 \; 5^2 \, 29 \; 43 \; 71 \; 167 \; 769 \; 29063 \; 250233481 \; 1154762937707.]$$ This comes down to a few Fermat-Pell equations, as Gerhard "insert quote here" Paseman suggested; but the difficulty is not the size of the fundamental unit (which can be as small as $p + \sqrt{p^2-1}$) but the rare and unpredictable appearance of primes in the resulting sequence; I doubt that anything can be proved about the question. [The Diophantine equation for a triangle of sides $p,q,q-d$ to be Heronian is $(p^2-d^2) (2q-p-d) (2q+p-d) = x^2$.]