Brahmagupta triangle

A Brahmagupta triangle is a triangle whose side lengths are consecutive positive integers and area is a positive integer. The triangle whose side lengths are 3, 4, 5 is a Brahmagupta triangle and so also is the triangle whose side lengths are 13, 14, 15. The Brahmagupta triangle is a special case of the Heronian triangle which is a triangle whose side lengths and area are all positive integers but the side lengths need not necessarily be consecutive integers. A Brahmagupta triangle is called as such in honor of the Indian astronomer and mathematician Brahmagupta (c. 598 – c. 668 CE) who gave a list of the first eight such triangles without explaining the method by which he computed that list.

A Brahmagupta triangle is also called a Fleenor-Heronian triangle in honor of Charles R. Fleenor who discussed the concept in a paper published in 1996. Some of the other names by which Brahmagupta triangles are known are super-Heronian triangle and almost-equilateral Heronian triangle.

The problem of finding all Brahmagupta triangles is an old problem. A closed form solution of the problem was found by Reinhold Hoppe in 1880.

Generating Brahmagupta triangles
Let the side lengths of a Brahmagupta triangle be $$t -1 $$, $$ t$$ and $$ t+1 $$ where $$t $$ is an integer greater than 1. Using Heron's formula, the area $$ A $$ of the triangle can be shown to be
 * $$A=\big(\tfrac{t}{2}\big)\sqrt{3\big[ \big(\tfrac{t}{2}\big)^2 -1 \big] } $$

Since $$ A$$ has to be an integer, $$t $$ must be even and so it can be taken as $$t=2x $$ where $$ x$$ is an integer. Thus,
 * $$A = x\sqrt{3(x^2-1) } $$

Since $$ \sqrt{3(x^2-1) } $$ has to be an integer, one must have $$x^2-1 =3y^2 $$ for some integer  $$ y $$. Hence, $$ x $$ must satisfy the following Diophantine equation:
 * $$x^2-3y^2=1 $$.

This is an example of the so-called Pell's equation $$x^2-Ny^2=1 $$ with $$N=3$$. The methods for solving the Pell's equation can be applied to find values of the integers $$x$$ and $$y$$.



Obviously $$ x=2 $$, $$ y=1 $$ is a solution of the equation $$x^2-3y^2=1 $$. Taking this as an initial solution $$x_1=2, y_1=1$$ the set of all solutions $$\{(x_n, y_n)\}$$ of the equation can be generated using the following recurrence relations

x_{n+1}=2x_n+3y_n, \quad y_{n+1}= x_n+2y_n \text{ for } n=1,2,\ldots $$ or by the following relations

\begin{align} x_{n+1} & = 4x_{n}-x_{n-1}\text{ for }n=2,3,\ldots \text{ with } x_1=2, x_2=7\\ y_{n+1} & = 4y_{n}-y_{n-1}\text{ for }n=2,3,\ldots \text{ with } y_1=1, y_2=4. \end{align} $$ They can also be generated using the following property:

x_n+\sqrt{3} y_n=(x_1+\sqrt{3}y_1)^n\text{ for } n=1,2, \ldots $$ The following are the first eight values of $$x_n $$ and $$y_n$$ and the corresponding Brahmagupta triangles:
 * {| class="wikitable"

! $$n$$ !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 triangle||3,4,5||13,14,15||51,52,53||193,194,195||723,724,725||2701,2702,2703||10083,10084,10085||37633,37634,337635 The sequence $$\{x_n\}$$ is entry in the Online Encyclopedia of Integer Sequences (OEIS) and the sequence $$\{y_n\}$$ is entry  in OEIS.
 * $$x_n$$ || 2 || 7 || 26 || 97 || 362 || 1351 || 5042 || 18817
 * $$y_n$$ || 1 || 4 || 15 || 56 || 209 || 780 || 2911 || 10864
 * Brahmagupta
 * $$y_n$$ || 1 || 4 || 15 || 56 || 209 || 780 || 2911 || 10864
 * Brahmagupta
 * Brahmagupta
 * }

Generalized Brahmagupta triangles
In a Brahmagupta triangle the side lengths form an integer arithmetic progression with a common difference 1. A generalized Brahmagupta triangle is a Heronian triangle in which the side lengths form an arithmetic progression of positive integers. Generalized Brahmagupta triangles can be easily constructed from Brahmagupta triangles. If $$t-1, t, t+1$$ are the side lengths of a Brahmagupta triangle then, for any positive integer $$k$$, the integers $$k(t-1), kt, k(t+1)$$ are the side lengths of a generalized Brahmagupta triangle which form an arithmetic progression with common difference $$k$$. There are generalized Brahmagupta triangles which are not generated this way. A primitive generalized Brahmagupta triangle is a generalized Brahmagupta triangle in which the side lengths have no common factor other than 1.

To find the side lengths of such triangles, let the side lengths be $$t-d, t, t+d$$ where $$b,d$$ are integers satisfying $$1\le d\le t$$. Using Heron's formula, the area $$A$$ of the triangle can be shown to be
 * $$ A = \big(\tfrac{b}{4}\big)\sqrt{3(t^2-4d^2)}$$.

For $$A$$ to be an integer, $$t $$ must be even and one may take $$t=2x $$ for some integer. This makes
 * $$A=x\sqrt{3(x^2-d^2)}$$.

Since, again, $$A $$ has to be an integer, $$ x^2-d^2 $$ has to be in the form $$3y^2$$ for some integer $$y$$. Thus, to find the side lengths of generalized Brahmagupta triangles, one has to find solutions to the following homogeneous quadratic Diophantine equation:
 * $$x^2-3y^2=d^2$$.

It can be shown that all primitive solutions of this equation are given by

\begin{align} d & = \vert m^2 - 3n^2\vert /g\\ x & = (m^2 + 3n^2)/g\\ y & = 2mn/g \end{align} $$ where $$m$$ and $$n$$ are relatively prime positive integers and $$g = \text{gcd}(m^2 - 3n^2, 2mn, m^2 + 3n^2) $$.

If we take $$ m=n=1$$ we get the Brahmagupta triangle $$(3,4,5)$$. If we take $$ m=2, n=1$$ we get the Brahmagupta triangle $$(13,14,15)$$. But if we take $$ m=1, n=2$$ we get the generalized Brahmagupta triangle $$(15, 26, 37)$$ which cannot be reduced to a Brahmagupta triangle.