I'm trouble shooting my code I wrote to generate all Heronian Triangles (triangle with integer sides and integer area). I'm using the following algorithm
$$a=n(m^{2}+k^{2})$$ $$b=m(n^{2}+k^{2})$$ $$c=(m+n)(mn-k^{2})$$ $$\text{Semiperimeter}=mn(m+n)$$ $$\text{Area}=mnk(m+n)(mn-k^{2})$$
for integers $m$, $n$ and $k$ subject to the contraints:
$$\gcd{(m,n,k)}=1$$ $$mn > k^2 \ge m^2n/(2m+n)$$ $$m \ge n \ge 1$$
which I found here http://en.wikipedia.org/wiki/Integer_triangle#Heronian_triangles
The odd part is that this algorithm doesn't seem to ever generate 7, 24, 25 which is a Hero Triangle (a right triangle, in fact) with integer area 84.
I had originally assumed it was a breakdown in my code, but then I realized I can't seem to find any values of $m$, $n$, or $k$ within the constraints or even ignoring the constraints that generate this triangle.
I don't know which is which between which of the 7, 24, or 25 equal the $a$, $b$, or $c$, but I've tried manually solving for $m$ and $n$ using wolframalpha. Since $a$ and $b$ are symmetric (since $m$ and $n$ are symmetric when ignoring constraints), I really only have 3 sets of linear equations to check:
$$7=n(m^{2}+k^{2})$$ $$24=m(n^{2}+k^{2})$$ $$25=(m+n)(mn-k^{2})$$
Wolframalpha - Linear equations 1
$$24=n(m^{2}+k^{2})$$ $$25=m(n^{2}+k^{2})$$ $$7=(m+n)(mn-k^{2})$$
Wolframalpha - Linear equations 2
$$25=n(m^{2}+k^{2})$$ $$7=m(n^{2}+k^{2})$$ $$24=(m+n)(mn-k^{2})$$
Wolframalpha - Linear equations 3
None of which have integer solutions.
Is my understanding of Hero Triangles wrong? Is the algorithm wrong? Is my implementation wrong?