OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Heronian Triangle.
R. Zumkeller, Integer-sided triangles
EXAMPLE
MATHEMATICA
maxPerim = 100; maxSide = Floor[(maxPerim - 1)/2]; order[{a_, b_, c_}] := (a + b + c)*maxPerim^3 + a*maxPerim^2 + b*maxPerim + c; triangles = Reap[ Do[ If[ a + b + c <= maxPerim && c - b < a < c + b && b - a < c < b + a && c - a < b < c + a, Sow[{a, b, c}]], {a, 1, maxSide}, {b, a, maxSide}, {c, b, maxSide}]][[2, 1]]; stri = Sort[ triangles, order[#1] < order[#2]&]; area[{a_, b_, c_}] := With[{p = (a + b + c)/2}, Sqrt[p*(p - a)*(p - b)*(p - c)]]; Position[ stri, tri_ /; IntegerQ[area[tri]]] // Flatten (* Jean-François Alcover, Feb 22 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 05 2002
STATUS
approved