TITLE: Heronian triangle Generator
QUESTION [6 upvotes]: 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?

REPLY [2 votes]: Schubert's paper can be found online here: http://www.oocities.org/teufel_pi/papers/gidag.pdf
Note that $\gcd(p,q=1)$ also.  This approach has the same problem as Brahmagupta's parameterization: not all primitive heron triangles are directly generated.  In particular the 13,14,15 triangle is generated as the 26,28,30 triangle with parameters m=2, n=1, p=3, q=2.
Sascha Kurz discusses the subject here: 
http://www.wm.uni-bayreuth.de/fileadmin/Sascha/Publikationen/On_Heronian_Triangles.pdf
He gives an O(N^(2+e)) algorithm or two for generating triangles with sides smaller than N.