Geometry

Triangles whose area is a whole number

A triangle with sides 13, 14 and 15 has area exactly 84, because an altitude of 12 cuts it into the right triangles 5, 12, 13 and 9, 12, 15. Most triangles with whole sides and whole area are built that way, but not all: 5, 29, 30 has area 72 and no whole altitude at all. Every such area is a multiple of 6, the ones with consecutive sides follow Pell's equation, exactly five have area equal to perimeter — and whether one can have three whole medians nobody knows.

Worth reading first: A tree that holds every triple · The areas a right triangle can have.

A right triangle with whole sides — 3, 4, 5, or 5, 12, 13 — always has a whole-number area, because its area is half the product of its legs and one leg of every Pythagorean triple is even. For triangles in general, whole sides do not give a whole area. The triangle with sides 2, 3, 4 has area 3415\tfrac{3}{4}\sqrt{15}, and an equilateral triangle with side 2 has area 3\sqrt3. A triangle whose sides and area are whole numbers is called Heronian, after Heron of Alexandria, whose formula for the area from the three sides decides the question at once:

16A2=(a+b+c)(−a+b+c)(a−b+c)(a+b−c).16A^2 = (a + b + c)(-a + b + c)(a - b + c)(a + b - c).

The area is a whole number exactly when that product of four whole numbers is sixteen times a perfect square. That turns the question into a search, and the search is easy: run through every triple of sides up to a bound, compute the product, and test it. This essay does that for every triangle with no side longer than 300, and longer for some questions, and draws what comes out. Most of what comes out is Pythagoras in disguise. Some of it is not, and one question the search raises — whether a triangle can have whole sides, whole area and three whole medians — is still open.

Two right triangles glued along a leg

Heronian triangles as two right triangles. 13-14-15 = 5-12-13 + 9-12-15; 5-29-30 altitude 4.8, indecomposable
Fig. 1 Two triangles with whole sides and whole area. An altitude of 12 cuts 13, 14, 15 into the right triangles 5, 12, 13 and 9, 12, 15, so its area 84 is 30 plus 54. The altitudes of 5, 29, 30 are all fractions, and it splits only into right triangles with fractional sides.

The commonest way to build a Heronian triangle is to take two Pythagorean triangles that share a leg and stand them back to back. The triple 5, 12, 13 and the triple 9, 12, 15 both have a leg of 12; put them side by side along it and the result has sides 13, 14 and 15, with the shared leg as its altitude and the two short legs, 5 and 9, adding up to the base. Its area is 12×14×12=84\tfrac12 \times 14 \times 12 = 84, which is the two right triangles’ areas, 30 and 54, added. This is the figure’s left half, and it is the reason 13, 14, 15 is the textbook example: it is the smallest Heronian triangle that is neither right-angled nor isosceles.

Every Heronian triangle comes close to this shape. Its altitudes are 2A2A divided by each side, which are always fractions, and the altitude onto the longest side lands inside the base, cutting the triangle into two right triangles whose sides are all rational. But they need not be whole. The figure’s right half is 5, 29, 30, with area 72: its three altitudes are 1445\tfrac{144}{5}, 14429\tfrac{144}{29} and 245\tfrac{24}{5}, none a whole number, so no cut along an altitude leaves two triangles with whole sides. Cut along the altitude onto 30, of height 4.8, and the pieces have sides 1.4, 4.8, 5 and 28.6, 4.8, 29. Multiply everything by 5 and they become 7, 24, 25 and 143, 24, 145 — genuine Pythagorean triples sharing the leg 24 — and the triangle becomes 25, 145, 150, which is the old one scaled.

So every Heronian triangle is two right triangles with whole sides glued along a common leg, after a scaling; the scaling is needed for some and not others, and 5, 29, 30 is the smallest that needs it. The right triangles in turn come from the tree that holds every triple, so Heronian triangles are exactly the pairs of triples whose legs can be made to match.

Heron’s formula is Pythagoras twice

Heron’s formula looks like a separate fact, but it is the same gluing run backwards. Drop the altitude hh onto the side cc, and let it cut cc into pieces uu and c−uc - u. The two right triangles it makes give, by Pythagoras, a2=h2+(c−u)2a^2 = h^2 + (c-u)^2 and b2=h2+u2b^2 = h^2 + u^2. Subtracting eliminates hh and gives u=(b2+c2−a2)/2cu = (b^2 + c^2 - a^2)/2c, which is the law of cosines in disguise. Putting uu back gives h2=b2−u2h^2 = b^2 - u^2, and then 16A2=4c2h2=4b2c2−(b2+c2−a2)216A^2 = 4c^2h^2 = 4b^2c^2 - (b^2 + c^2 - a^2)^2. That difference of two squares factors once, into (2bc−b2−c2+a2)(2bc+b2+c2−a2)(2bc - b^2 - c^2 + a^2)(2bc + b^2 + c^2 - a^2), and each factor is again a difference of squares, (a−b+c)(a+b−c)(a - b + c)(a + b - c) and (b+c−a)(b+c+a)(b + c - a)(b + c + a). Heron’s four factors are what Pythagoras’s two triangles leave behind.

So the formula and the picture are one thing. When uu and hh are whole numbers, the triangle is visibly two Pythagorean triangles; when they are fractions, as for 5, 29, 30, where u=1.4u = 1.4 and h=4.8h = 4.8, the same two triangles exist with fractional sides, and Heron’s product is still a perfect square because their areas add to a whole number. A whole area needs only that hh times cc be even, not that hh be whole. The same computation underlies the circumradius found from the three sides, which divides the product of the sides by four times this area. And the oldest Heronian triangle of all, 3, 4, 5, is the rope with twelve knots that squares a corner: area 6, the smallest multiple of 6 there is.

The census, and the 6 that divides every area

How many Heronian triangles there are. N=300: all 991, right 47, isosceles 71, indecomposable 279
Fig. 2 Every Heronian triangle in lowest terms, counted by its largest side: 991 with largest side up to 300. Of these, 47 are right-angled, 71 isosceles and 279 cannot be cut by any altitude into two right triangles with whole sides.

The census runs through every triangle with sides a≤b≤c≤300a \le b \le c \le 300, keeps those with no common factor — scaling a Heronian triangle by any whole number gives another, so only triangles in lowest terms are counted — and tests Heron’s product. There are 991. The figure counts them against the largest side and sorts out three kinds. The right-angled ones are the primitive Pythagorean triples, 47 of them up to 300. The isosceles ones are a Pythagorean triangle and its mirror image glued along the longer or shorter leg, such as 5, 5, 6 and 5, 5, 8, both from 3, 4, 5; there are 71. And 279 of the 991, more than a quarter, are like 5, 29, 30: no altitude splits them into whole right triangles.

Every one of the 991 has an even perimeter and an area divisible by 6. The perimeter is the easier half: Heron’s product is (a+b+c)(a+b+c) times three numbers of the same parity as it, so if the perimeter were odd the product would be odd and could not be sixteen times a square. The 6 needs more. A case analysis of the sides modulo 4 and modulo 3 shows that the product is always divisible by 16⋅4⋅916 \cdot 4 \cdot 9 — two factors of 2 and two of 3 beyond the 16 — and that makes A2A^2 divisible by 36. The same 6 divides the area of every Pythagorean triangle, and the theorem is the general form of that one, which the census confirms on every triangle it finds.

The counts grow a little faster than in proportion to the largest side, visible as the slight upward bend of the top curve. The share of triangles that need a scaling to split grows with size too: among small triangles nearly every Heronian one is a visible pair of triples, and among large ones a growing share are not.

Consecutive sides and Pell’s equation

Heronian triangles with consecutive sides. middle sides 4,14,52,194,724,2702,10084,37634
Fig. 3 The Heronian triangles with three consecutive whole sides: 3, 4, 5, then 13, 14, 15 and 51, 52, 53, each with its whole altitude onto the middle side. The middle sides run 4, 14, 52, 194, 724, 2702, 10084, each 4 times the last minus the one before.

The census finds four triangles with consecutive sides below 300: 3, 4, 5; 13, 14, 15; 51, 52, 53; and 193, 194, 195. Their middle sides are 4, 14, 52 and 194, and each is four times the one before minus the one before that: 4⋅14−4=524 \cdot 14 - 4 = 52, 4⋅52−14=1944 \cdot 52 - 14 = 194. The rule continues to 724, 2702, 10084, and the triangles never stop.

The reason is a Pell equation. Write the sides as 2m−12m - 1, 2m2m, 2m+12m + 1 — the middle side must be even for the perimeter to be — and Heron’s formula gives A2=3m2(m2−1)A^2 = 3m^2(m^2 - 1). So the area is whole exactly when m2−1=3y2m^2 - 1 = 3y^2, that is when (m,y)(m, y) solves

m2−3y2=1.m^2 - 3y^2 = 1.

This is the Pell equation for 3, and its solutions are generated from the smallest, (2,1)(2, 1), by the same squaring that makes one solution produce all the others: (2+3)k=mk+yk3(2 + \sqrt3)^k = m_k + y_k\sqrt3 gives m=2,7,26,97,362,…m = 2, 7, 26, 97, 362, \ldots, which halve the middle sides. The recurrence mk+1=4mk−mk−1m_{k+1} = 4m_k - m_{k-1} comes from 2+32 + \sqrt3 and 2−32 - \sqrt3 being the two roots of x2−4x+1x^2 - 4x + 1, so successive triangles grow by a factor approaching 2+3≈3.7322 + \sqrt3 \approx 3.732. The altitude onto the middle side is 3y3y — 3, 12, 45, 168 — always whole, so these triangles always split into two Pythagorean triangles, with base pieces m−2m - 2 and m+2m + 2 that differ by exactly 4. The triangle 13, 14, 15 is the k=2k = 2 case of an infinite family, and every member is a pair of right triangles whose short legs differ by 4.

Five triangles whose area is their perimeter

The five triangles whose area equals their perimeter. 6-8-10 5-12-13 9-10-17 7-15-20 6-25-29
Fig. 4 The only five triangles with whole sides whose area equals their perimeter: 6, 8, 10; 5, 12, 13; 9, 10, 17; 7, 15, 20; and 6, 25, 29. Each carries an inscribed circle of radius exactly 2.

A puzzle much older than the computer asks for triangles with whole sides whose area, in square units, is the same number as their perimeter, in units. Searching every triangle with sides up to 200 finds exactly five: 6, 8, 10 with area and perimeter 24; 5, 12, 13 with 30; 9, 10, 17 with 36; 7, 15, 20 with 42; and 6, 25, 29 with 60. Two are right-angled and three are not.

The search is not merely a long list that stopped at 200; five is provably all of them, and the figure shows why. The area of any triangle is the radius of its inscribed circle times half its perimeter — cut the triangle into three pieces from the incentre, each a triangle with height rr on one side. So area equal to perimeter means r⋅P/2=Pr \cdot P/2 = P, that is r=2r = 2, and every one of the five carries exactly the same inscribed circle, of radius 2. A triangle circumscribing a fixed circle has its angles determined by the three tangent lengths, and with an inscribed radius of 2 and whole sides the tangent lengths x,y,zx, y, z must satisfy xyz=4(x+y+z)xyz = 4(x + y + z), an equation with only finitely many solutions in positive numbers whose sums in pairs are whole, which a short search exhausts.

That is a different kind of finiteness from the census. There, the triangles go on for ever and the search lists the small ones; here, a condition fixes the inscribed circle, and a fixed circle admits only a few triangles with whole sides around it.

Medians, and the triangle nobody has found

Heronian triangles and their medians. N=500 total 2197: medians 1912/284/1/0; two: 26-51-73-420
Fig. 5 Every Heronian triangle in lowest terms with largest side up to 500 — 2,197 of them — sorted by how many of its three medians have rational length: 1,912 have none, 284 one, a single triangle, 26, 51, 73, has two, and none has three.

A median joins a corner to the middle of the opposite side, and its length is 122b2+2c2−a2\tfrac12\sqrt{2b^2 + 2c^2 - a^2} — rational exactly when the expression under the root is a perfect square. A Heronian triangle with all three medians rational, and therefore, after scaling, with whole sides, whole area and whole medians, is called a perfect triangle. None is known.

The figure runs the test over all 2,197 Heronian triangles in lowest terms with largest side up to 500. Most, 1,912, have no rational median. Another 284 have one; among them is every isosceles triangle, whose median to the base is also its altitude and therefore rational. Exactly one, 26, 51, 73 with area 420, has two: its medians to the sides 51 and 73 are 972\tfrac{97}{2} and 352\tfrac{35}{2}, while the third is 1215184\tfrac12\sqrt{15184}, irrational. Ralph Buchholz and Randall Rathbun showed in the 1990s that infinitely many Heronian triangles have two rational medians, through a family of elliptic curves. Whether any has three is open. It is the triangle’s version of the box with every edge, face diagonal and body diagonal whole, the perfect cuboid — another object defined by a handful of square conditions on whole numbers, searched for far beyond any figure’s range, and neither found nor ruled out.

The conditions look innocent. Heron’s formula says one product is sixteen times a square, and each median adds one more expression that must be a square. But each new square condition cuts the solutions down to points on a curve or surface of higher genus, and with four such conditions at once there is no known way to decide whether any point survives.

Every one from a single rule

Every small Heronian triangle from Brahmagupta's rule. N=60: 74 triangles all reached
Fig. 6 All 74 Heronian triangles in lowest terms with largest side up to 60, with their areas, every one produced by Brahmagupta’s rule and checked exactly with Heron’s formula.

Brahmagupta, in the seventh century, gave a rule that produces Heronian triangles from three whole numbers mm, nn and kk with k2<mnk^2 < mn: the sides

n(m2+k2),m(n2+k2),(m+n)(mn−k2)n(m^2 + k^2), \quad m(n^2 + k^2), \quad (m + n)(mn - k^2)

have area mnk(m+n)(mn−k2)mnk(m + n)(mn - k^2). The rule is the gluing made algebraic. The two right triangles glued along their common altitude have legs in the ratios fixed by m/km/k and n/kn/k, and the formula is what scaling them to a common leg and clearing denominators produces. Running the rule over every mm, nn, kk up to 60, dividing out common factors and sorting the sides reaches all 74 of the Heronian triangles in lowest terms with largest side up to 60, and Heron’s formula holds exactly for every one produced. The figure lists them.

The search found the triangles and the rule explains them. They are the same set, which is the content of the theorem that Brahmagupta’s rule — or the gluing of Pythagorean triangles, which is the same thing — gives every Heronian triangle up to scaling. The list also shows how irregular the set is: areas jump from 6 to 1,260, and long stretches of largest sides have none.

What a census cannot decide

The figures show triangles with sides up to a bound, and every statement about all Heronian triangles rests on an argument rather than on the census: that the area is always a multiple of 6, that consecutive sides follow Pell’s equation for ever, that the area-equals-perimeter list is complete, that Brahmagupta’s rule reaches every triangle. The census confirms each of those as far as it goes and could have refuted any of them; it cannot prove them.

The median question is the sharpest case. A search to 500 finds one triangle with two rational medians and none with three. That is evidence of nothing in particular: the known triangles with two rational medians become very large very fast, and a perfect triangle, if one exists, could be beyond any search yet run. The figure cannot even show that 26, 51, 73 is the smallest with two rational medians in a strong sense — only that it is the only one with largest side below 500.

Finally, the pictures draw triangles in the flat plane. On a sphere or in hyperbolic space the area of a triangle depends on its angles rather than its sides alone, and the question of whole sides and whole area becomes a different one, about angles that are rational multiples of a turn, which nothing here addresses.

Still open: the perfect triangle and its neighbours

The perfect triangle is the headline open problem: whole sides, whole area, three whole medians, and no example and no proof of impossibility. It has relatives that are equally stuck. And the question that sits beneath all of them — which pairs of Pythagorean triples can share a leg, and how often — is a question about the areas a right triangle can have in disguise, since two triangles glued along a leg have areas in the ratio of their other legs, and that ratio question leads to the congruent numbers and the elliptic curves behind them.

A more modest question is how fast the census grows. The count of Heronian triangles in lowest terms with largest side up to NN grows a little faster than NN in the census, and pinning down the exact rate is a question about how often Heron’s product is a square, a counting problem of the same kind as the one that counts the whole points on circles.

Pythagoras, glued

A Heronian triangle — whole sides, whole area — is two Pythagorean triangles glued along a common leg, after a scaling that 5, 29, 30 and more than a quarter of all small examples need. Heron’s formula makes the search exhaustive: 991 in lowest terms to largest side 300, every area a multiple of 6, every perimeter even, and all 74 below side 60 produced by Brahmagupta’s rule. Consecutive sides 13, 14, 15 and its successors come from Pell’s equation m2−3y2=1m^2 - 3y^2 = 1 and grow by 2+32 + \sqrt3; exactly five triangles have area equal to perimeter, all around the same inscribed circle of radius 2. And the obvious next condition — that the three medians be whole too — has no known example and no proof that none exists: up to side 500 a single triangle, 26, 51, 73, manages even two.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Exhaustive searchHeron formulaIncircleParametrisationPell equationPythagorean triples