OFFSET
0,1
LINKS
Eric Weisstein's World of Mathematics, Heronian Triangle.
MATHEMATICA
sideMax = 60; r[c_] := Reap[Do[ p = (a + b + c)/2; red = Reduce[ area > 1 && a < b < c && area^2 == p*(p - a)*(p - b)*(p - c), area, Integers]; If[red =!= False, sol = {a, b, c, area} /. {ToRules[red]}; Sow[sol]], {b, 1, c - 1}, {a, c - b, b - 1}]]; triangles = Flatten[ Reap[ Do[rc = r[c]; If[rc[[2]] =!= {}, Sow[rc[[2, 1]]]], {c, 5, sideMax}]][[2, 1]] , 2]; Sort[ triangles, Which[#1[[3]] < #2[[3]], True, #1[[3]] > #2[[3]], False, #1[[2]] < #2[[2]], True, #1[[2]] > #2[[2]], False, #1[[1]] <= #2[[1]], True, True, False] &][[All, 4]] (* Jean-François Alcover, Oct 29 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved