Heron triangles and the hunt for unicorns

A Heron triangle is one that has all integer side lengths and integer area, which takes its name from Heron of Alexandria's area formula. From a more relaxed point of view, if rescaling is allowed, then one can define a Heron triangle to be one whose side lengths and area are all rational numbers. A perfect triangle is a Heron triangle with all three medians being rational. According to a longstanding conjecture, no such triangle exists, so perfect triangles are as rare as unicorns. However, if perfect is the enemy of good, then perhaps it is best to insist on only two of the medians being rational. Buchholz and Rathbun found an infinite family of Heron triangles with two rational medians, which they were able to associate with the set of rational points on an elliptic curve $E(\mathbb{Q})$. Here we describe a recently discovered explicit formula for the sides, area and medians of these (almost perfect) triangles, expressed in terms of a pair of integer sequences: these are Somos sequences, which first became popular thanks to David Gale's column in Mathematical Intelligencer.


Pythagorean triples
One of the oldest problems in the theory of Diophantine equations is to find right-angled triangles with integer side lengths, or equivalently triples of positive integers (a, b, c) such that which are called Pythagorean triples.Examples were known to the Babylonians in around 1800 B.C. Taking positive integers m > n and τ, all such triples can be determined from the formula which was presented by Euclid, but without the arbitrary scale factor τ. A primitive Pythagorean triple is one for which gcd(a, b, c) = 1, and (up to switching a and b) all primitive triples are obtained from (1.2) by taking τ = 1, and m, n coprime with at least one of them being even.The formula (1.2) can be derived directly by starting from simple congruences mod 2 and mod 4, but another way to obtain it is to consider rational points on an algebraic curve, namely the unit circle For any rational point (x, y) ∈ Q 2 on this circle, distinct from the point (−1, 0), we form the chord joining them, given by the line y = t(x + 1) with slope t.Hence we find the rational parametrization of the circle, related to the usual trigonometric parametrization x = cos θ, y = sin θ by the "t-substitution" of integral calculus, that is t = tan θ 2 , and formula (1.2) follows from taking rational t = n m with 0 < t < 1.

Heron triangles and unicorns
For a triangle with sides (a, b, c) and semiperimeter s, the area formula is attributed to Heron of Alexandria.If the side lengths are integers and the area ∆ is also an integer, then this is called a Heron triangle.Allowing the freedom to rescale all the sides by the same factor, it is convenient to define a triangle to be Heron whenever the side lengths and the area are all rational numbers.Trivially, any right-angled triangle given by a Pythagorean triple is Heron.More generally, dropping a perpendicular from any vertex of a Heron triangle splits it into a pair of right-angled triangles with the same height, either joined back-to-back, or overlapping one another, and it is not hard to see that both triangles must have rational sides, so that (up to rescaling) the Heron triangle is built from a pair of Pythagorean triples.This construction can be used to derive a parametric formula for Heron triangles, that is for arbitrary positive rational numbers p, q, r such that r 2 ̸ = pq, which was known to Brahmagupta in the 7th century A.D. [3].To see a particular example, taking p = 3, q = 4, r = 6 in (2.2) leads to the Heron triangle with a = 15, b = 13, c = 14 and area ∆ = 84, which can be built out of the (5,12,13) and (9,12,15) Pythagorean triples, by placing these two right-angled triangles back-to-back along the height 2r = 12, as in Fig. 1. (This choice of parameters is not unique: for instance, ordering the sides differently as (a, b, c) = (15, 14, 13) instead of (15, 13, 14), the same Heron triangle can be obtained from p = 147 13 , q = 126 13 , r = 84 13 .)A systematic method for enumerating Heron triangles with integer sides was given by Schubert [11].In Schubert's scheme, (15, 13, 14) is the first example of a Heron triangle with integer sides which is not right-angled or isosceles.However, if we combine the same two Pythagorean triples by overlapping the triangles (rather than back-to-back as in the figure), then we get the (15, 13, 4) Heron triangle with a smaller area ∆ = 24, which nevertheless appears further down in Schubert's list.
The unicorns in our story are perfect triangles: triangles which have all integer sides, all integer medians, and integer area.Does a perfect triangle exist, or equivalently, is there a Heron triangle with three rational medians?It is believed that there is no such thing, but despite incorrect "proofs" in the literature, the problem remains open [7].The rest of our discussion is devoted to seeing how close we can get to perfection.
Henceforth the medians bisecting sides a, b, c are denoted k, ℓ, m, respectively, which leads to the relations We label the angles adjacent to the median k as in Fig. 2, and our first step towards the elusive perfect triangle will be to consider the requirement that just this median should be rational.3 Heron triangles with one rational median From a construction of parallelograms with rational sides, area and diagonals, Schubert was led to the case of Heron triangles with one median being rational, and went on to present an argument that such triangles could not have a second rational median, which a fortiori would rule out the existence of perfect triangles.However, as pointed out by Dickson [3], this argument contained an oversight.This flaw notwithstanding, an identity of Schubert for Heron triangles with one rational median is crucial for what follows.
If we write b, c, k for the vectors corresponding to the lengths b, c, k, respectively, directed outwards from the top vertex in Fig. 2, and a 2 ak sin γ; so combining these relations produces the identity Given three angles α, β, γ in the interval (0, π), subject to α + β < π, it is convenient to take as parameters, and then by standard trigonometric identities (equivalent to the "t-substitution" in (1.3) above) the identity (3.1) becomes a rational relation between these three quantities, namely This gives the equation of a surface in three-dimensional space with coordinates (M, P, X), which can be rewritten as the vanishing of a polynomial: 2M P (X 2 − 1) + M X(P 2 − 1) − P X(M 2 − 1) = 0; we refer to it as the Schubert surface.
From the half-angle identity cot α 2 = sin α/(1 − cos α) we have M = ∆/(bk − b • k).Using the analogous expressions for P and X, together with dot product relations, we can express these Schubert parameters in terms of the area, side lengths and the median by the formulae (3.4) The ratios of the side lengths are given in terms of the Schubert parameters by The formulae (3.4) show that each Heron triangle with a rational median k produces a rational point on the Schubert surface (3.3), with positive coordinates (M, P, X) ∈ Q 3 .How about the converse: does every rational point on this surface correspond to a Heron triangle with (at least) one rational median?In fact, using certain discrete symmetries of the surface (sending (M, P, X) → (M −1 , P −1 , X −1 ), or replacing one of the Schubert parameters by minus its reciprocal), we can start with any triple of non-zero values (M, P, X) ∈ Q 3 satisfying (3.3), and turn it into a valid positive triple.Then the side lengths (a, b, c) are determined by (M, P, X) using the rational expressions (3.5), up to an arbitrary choice of scale; after fixing the scale, any two of the equations (3.4) allow the rational numbers k and ∆ to be recovered.

Triangles with two rational medians
In striving to get closer to perfection, another possible direction for our first step is to drop the initial requirement that the area ∆ should be rational, and just consider triangles with rational sides (a, b, c) and two rational medians k, ℓ.In his PhD thesis, Buchholz obtained a rational parametrization of all such triangles, given by the formulae where θ, ϕ are rational numbers subject to constraints ensuring positivity of the side lengths, namely and the positive parameter τ ∈ Q allows for the arbitrary choice of scale.Conversely, the parameters (θ, ϕ) ∈ Q 2 can be written as rational functions of the side lengths and two medians, given by where s =1 2 (a + b + c) is the semiperimeter, as before.Note that in (4.3) there are two independent choices of ± signs, and hence four different pairs (θ, ϕ) associated with the same rational triangle with two rational medians.

Intermezzo: Somos-sequences
Before we continue on our quest for the perfect triangle, we must recall some beautiful observations made by Michael Somos [12].The saga of Somos sequences attracted widespread attention due to Mathematical Intelligencer articles by David Gale [6], and provided inspiration for the study of the Laurent phenomenon and its development in Fomin and Zelevinksy's theory of cluster algebras [4,5], which has been one of the hottest topics in algebra for almost 25 years.
A recurrence relation of Somos type is a homogeneous quadratic recurrence relation of a particular form.Here we focus on the example of Somos-5, which is the recurrence relation of order 5 given by and consists entirely of integers.This seems very surprising, because at each iteration of (5.1) one must divide the right-hand side by S n to obtain the new term S n+5 .The Laurent property provides one explanation for the integrality of the sequence (5.2): if the initial values S j , 1 ≤ j ≤ 5 for the recurrence are considered as variables, then each iterate turns out to be a polynomial in these quantities and their reciprocals with integer coefficients: 5 ) (that is, a Laurent polynomial).Upon substituting S 1 = S 2 = S 3 = S 4 = S 5 = 1 into each polynomial P n , the integer sequence (5.2) results.
Another completely different way to understand Somos-5 sequences relies on a connection with integrable maps, which are discrete analogues of exactly solvable systems in Hamiltonian mechanics.To see this connection, note that the recurrence (5.1) has three independent scaling symmetries: rescaling even/odd index terms separately, so S 2j → A + S 2j , S 2j+1 → A − S 2j+1 , and rescaling S n → B n S n for any n, where A + , A − , B are arbitrary non-zero constants.Moreover, we can form a sequence of ratios that is left invariant by these scaling symmetries, and find that it satisfies a recurrence of second order: By considering (U, V ) = (u n , u n+1 ) as a point in the plane, each shift n → n + 1 of the discrete "time" in (5.3) is equivalent to an iteration of a birational transformation (a rational map with a rational inverse): . (5.4) The transformation (5.4) is an example of a Quispel-Roberts-Thompson (QRT) map: such maps have arisen in various physical contexts, including statistical mechanics, nonlinear waves (solitons) and quantum field theory [10].In a suitable regime, the iterates of the map appear like a stroboscopic view of a mechanical system with one degree of freedom.More precisely, the transformation φ is area-preserving (symplectic): it preserves the logarithmic area element (U V ) −1 dU dV in the plane; and it obeys conservation of energy, where "energy" in this case is the rational function The level sets of this function are plane curves J = constant, and each orbit of φ lies on a fixed level set.The behaviour is especially regular in the positive quadrant U > 0, V > 0, where each orbit densely fills a compact oval (see Fig. 3, where 300 points are plotted on each orbit).We shall see that in relation to Heron triangles with two rational medians, two different integer sequences appear, namely the pair of Somos-5 sequences given by (S n ) : 1, 1, 1, 2, 3, 5, 11, 37, 83, 274, . . ., (T n ) : 0, 1, −1, 1, 1, −7, 8, −1, −57, 391, . . ., (5.6) where the terms above are listed starting from the index n = 0.The first one, (S n ), is just the original Somos-5 sequence (5.2), but indexed differently: it corresponds to the orbit of the map φ through the point (1, 1), while the second sequence, (T n ), corresponds to the orbit through the point (−1, 7).It is easily verified that both of these orbits lie on the same level curve J = 5 of the function (5.5), a plane cubic curve (total degree 3) which is also biquadratic (quadratic in both U and V ).The first orbit corresponds to the oval shown in red in Fig. 3, whereas the second orbit lies outside the positive quadrant, moving around the three unbounded components of this curve, which can be seen in Fig. 4. 6 Heron triangles with two rational medians Buchholz found the first example of a Heron triangle with two rational medians: the (73, 51, 26) triangle with area 420 and k = 35 2 , ℓ = 97 2 , which had been overlooked by Schubert in his work on parallelograms.After joining forces, Buchholz and Rathbun conducted a systematic search for such triangles, using the following algorithm based on (4.1): fix the scale τ = 1, enumerate pairs of rational numbers (θ, ϕ), and for each pair use Heron's formula (2.1) to check whether the area ∆ is rational [1].The first few triangles obtained from this search are shown in Table 1, where each triangle is represented by positive integers (a, b, c) with gcd(a, b, c) = 1: their initial investigations suggested that there should be an infinite family of such triangles (rows labelled with a positive integer n), together with an unknown number of sporadic triangles that do not fit into this family (rows labelled with asterisks).Heron triangles with two rational medians are associated with two different triples of Schubert parameters (M a , P a , X a ), (M b , P b , X b ), each corresponding to a particular set of angles α, β, γ adjacent to one of the medians k, ℓ, respectively.These triples provide two different rational points on the Schubert surface (3.3), coupled by two constraints coming from the ratios of side lengths, as in (3.5).Remarkably, by considering the patterns of prime factors appearing in these rational numbers, Buchholz and Rathbun found conjectural formulae for a subset of these parameter triples in terms of the two Somos sequences (5.6), such as and analogous expressions for the other elements of each triple.When, for successive integers n = 1, 2, 3, . .., they plotted the corresponding pairs (θ, ϕ) found from (4.3) with a fixed choice of ± signs, they found them to lie on one of five algebraic curves C j , 1 ≤ j ≤ 5, isomorphic to one another and repeating in a pattern with period 7, the simplest-looking curve being the biquadratic cubic It was pointed out by Elkies that the sequences (5.6) can be written using theta functions associated with the elliptic curve given by the equation which has infinitely many rational points,2 and is isomorphic (birationally equivalent) to C 4 .Indirectly, this led to a proof that every rational point (θ, ϕ) on the genus one curve C 4 given by (6.2), subject to the constraints (4.2), corresponds to a Heron triangle with two rational medians [2].
Table 2: Prime factors of the semiperimeter, reduced side lengths and area in the infinite family.
However, until very recently, (6.1) and the explicit expressions for the other Schubert parameters remained conjectural.The key to progress in [8] was to observe the elegant factorization pattern in the quantities appearing under the square root in Heron's formula, namely the semiperimeter s and the reduced side lengths s − a, s − b, s − c (see Table 2).It turns out that (up to an overall sign) each of these four quantities is given by a specific product of terms from the two Somos-5 sequences, leading to the following result.Theorem 6.1.For each integer n ≥ 1, the terms in the pair of Somos-5 sequences (S n ) and (T n ) in (5.6) provide a Heron triangle with two rational medians, having integer side lengths given by and integer area The curve (5.7) is birationally equivalent to the curve C 4 in (6.2), hence also to the curve (6.3).Its set of rational points is the union of two orbits of the map (5.4): the orbit associated with the sequence (S n ), lying on the oval in the positive quadrant in Fig. 4; and the orbit associated with (T n ), which jumps around the other three quadrants in a pattern that repeats with period 7. Thus these two Somos-5 sequences completely encode the structure of this infinite family of Heron triangles with two rational medians.It is natural to wonder if any of the triangles in this family can have a third rational median m, but it has been proven that this is not the case [9].Still, this leaves some big challenges to the reader: so far only four sporadic triangles have been found, which do not belong to the infinite family!The prime factorization of each semiperimeter and the reduced lengths in Table 3 give tantalizing hints of further structure.Can you extend the search to find more sporadic examples, and fit them into one or more new infinite families, encoded by Somos (or other) sequences?Or can you show that these four are the only sporadic triangles, thereby proving that unicorns do not exist?

Figure 2 :
Figure 2: Triangle with one labelled median

Figure 3 :
Figure 3: Some orbits of the map (5.4) in the positive quadrant.

Table 1 :
The smallest Heron triangles with two rational medians.