Formulas for generating Pythagorean triples

Last updated

Besides Euclid's formula, many other formulas for generating Pythagorean triples have been developed.

Contents

Euclid's, Pythagoras', and Plato's formulas

Euclid's, Pythagoras' and Plato's formulas for calculating triples have been described here:

The methods below appear in various sources, often without attribution as to their origin.

Fibonacci's method

Leonardo of Pisa (c.1170 – c.1250) described this method [1] [2] for generating primitive triples using the sequence of consecutive odd integers and the fact that the sum of the first n terms of this sequence is . If k is the n-th member of this sequence then .

Choose any odd square number k from this sequence () and let this square be the n-th term of the sequence. Also, let be the sum of the previous terms, and let be the sum of all n terms. Then we have established that and we have generated the primitive triple [a, b, c]. This method produces an infinite number of primitive triples, but not all of them.

EXAMPLE: Choose . This odd square number is the fifth term of the sequence, because . The sum of the previous 4 terms is and the sum of all terms is giving us and the primitive triple [a, b, c] = [3, 4, 5].

Sequences of mixed numbers

Michael Stifel published the following method in 1544. [3] [4] Consider the sequence of mixed numbers with . To calculate a Pythagorean triple, take any term of this sequence and convert it to an improper fraction (for mixed number , the corresponding improper fraction is ). Then its numerator and denominator are the sides, b and a, of a right triangle, and the hypotenuse is b + 1. For example:

Jacques Ozanam [5] republished Stifel's sequence in 1694 and added the similar sequence with . As before, to produce a triple from this sequence, take any term and convert it to an improper fraction. Then its numerator and denominator are the sides, b and a, of a right triangle, and the hypotenuse is b + 2. For example:

With a the shorter and b the longer legs of a triangle and c its hypotenuse, the Pythagoras family of triplets is defined by cb = 1, the Plato family by cb = 2, and the Fermat family by |ab| = 1. The Stifel sequence produces all primitive triplets of the Pythagoras family, and the Ozanam sequence produces all primitive triples of the Plato family. The triplets of the Fermat family must be found by other means.

Dickson's method

Leonard Eugene Dickson (1920) [6] attributes to himself the following method for generating Pythagorean triples. To find integer solutions to , find positive integers r, s, and t such that is a perfect square. Then:

From this we see that r is any even integer and that s and t are factors of r2/2. All Pythagorean triples may be found by this method. When s and t are coprime, the triple will be primitive. A simple proof of Dickson's method has been presented by Josef Rukavicka, J. (2013). [7]

Example: Choose r = 6. Then r2/2 = 18. The three factor-pairs of 18 are (1, 18), (2, 9), and (3, 6). All three factor pairs will produce triples using the above equations.

s = 1, t = 18 produces the triple [7, 24, 25] because x = 6 + 1 = 7, y = 6 + 18 = 24, z = 6 + 1 + 18 = 25.
s = 2, t = 9 produces the triple [8, 15, 17] because x = 6 + 2 = 8, y = 6 + 9 = 15, z = 6 + 2 + 9 = 17.
s = 3, t = 6 produces the triple [9, 12, 15] because x = 6 + 3 = 9, y = 6 + 6 = 12, z = 6 + 3 + 6 = 15. (Since s and t are not coprime, this triple is not primitive.)

Generalized Fibonacci sequence

Method I

For Fibonacci numbers starting with F1 = 0 and F2 = 1 and with each succeeding Fibonacci number being the sum of the preceding two, one can generate a sequence of Pythagorean triples starting from (a3, b3, c3) = (4, 3, 5) via

for n ≥ 4.

Method II

A Pythagorean triple can be generated using any two positive integers by the following procedures using generalized Fibonacci sequences.

For initial positive integers hn and hn+1, if hn + hn+1 = hn+2 and hn+1 + hn+2 = hn+3, then

is a Pythagorean triple. [8]

Method III

The following is a matrix-based approach to generating primitive triples with generalized Fibonacci sequences. [9] Start with a 2 × 2 array and insert two coprime positive integers (q,q) in the top row. Place the even integer (if any) in the left-hand column.

Now apply the following "Fibonacci rule" to get the entries in the bottom row:

Such an array may be called a "Fibonacci Box". Note that q, q, p, p is a generalized Fibonacci sequence. Taking column, row, and diagonal products we obtain the sides of triangle [a, b, c], its area A, and its perimeter P, as well as the radii ri of its incircle and three excircles as follows:

The half-angle tangents at the acute angles are q/p and q/p.

EXAMPLE:

Using coprime integers 9 and 2.

The column, row, and diagonal products are: (columns: 22 and 117), (rows: 18 and 143), (diagonals: 26 and 99), so

The half-angle tangents at the acute angles are 2/11 and 9/13. Note that if the chosen integers q and q are not coprime, then the same procedure leads to a non-primitive triple.

Pythagorean triples and Descartes' circle equation

This method of generating primitive Pythagorean triples also provides integer solutions to Descartes' Circle Equation, [9]

where integer curvatures ki are obtained by multiplying the reciprocal of each radius by the area A. The result is k1 = pp, k2 = qp, k3 = qp, k4 = qq. Here, the largest circle is taken as having negative curvature with respect to the other three. The largest circle (curvature k4) may also be replaced by a smaller circle with positive curvature ( k0 = 4ppqq).

EXAMPLE:

Using the area and four radii obtained above for primitive triple [44, 117, 125], we obtain the following integer solutions to Descartes' Equation: k1 = 143, k2 = 99, k3 = 26, k4 = (−18), and k0 = 554.

A Ternary Tree: Generating All Primitive Pythagorean Triples

Each primitive Pythagorean triple corresponds uniquely to a Fibonacci Box. Conversely, each Fibonacci Box corresponds to a unique and primitive Pythagorean triple. In this section we shall use the Fibonacci Box in place of the primitive triple it represents. An infinite ternary tree containing all primitive Pythagorean triples/Fibonacci Boxes can be constructed by the following procedure. [10]

Consider a Fibonacci Box containing two, odd, coprime integers x and y in the right-hand column.

It may be seen that these integers can also be placed as follows:

resulting in three more valid Fibonacci boxes containing x and y. We may think of the first Box as the "parent" of the next three. For example, if x = 1 and y = 3 we have:

Moreover, each "child" is itself the parent of three more children which can be obtained by the same procedure. Continuing this process at each node leads to an infinite ternary tree containing all possible Fibonacci Boxes, or equivalently, to a ternary tree containing all possible primitive triples. (The tree shown here is distinct from the classic tree described by Berggren in 1934, and has many different number-theoretic properties.) Compare: "Classic Tree". [11] See also Tree of primitive Pythagorean triples. [12]

Generating all Pythagorean triples using a predetermined positive integer

There is a method to construct all Pythagorean triples that contain a given positive integer x as one of the legs of the right-angled triangle associated with the triple. It means finding all right triangles whose sides have integer measures, with one leg predetermined as a given cathetus. [13] The formulas read as follows.

with

where

and if x is even with x = 2nk, n, and k 1 odd fixed, with

That is, regarding P(x), d must be even and such that x2/d is still divisible by 2.

Moreover, (x, y, z) is a primitive Pythagorean triple if both of the following conditions are verified: [14]

EXAMPLES

x = 12, C(x) = {2, 4, 6, 8, 12}
for d=2x=12y=35z=37primitive
for d=4x=12y=16z=20
for d=6x=12y=9z=15
for d=8x=12y=5z=13primitive
for d=12x=12y=0z=12trivial
x = 15, C(x) = {1, 3, 5, 9, 15}
for d=1x=15y=112z=113primitive
for d=3x=15y=36z=39
for d=5x=15y=20z=25
for d=9x=15y=8z=17primitive
for d=15x=15y=0z=15trivial

We remember that the Euclid’s formulas do not give all Pythagorean triples that involves a predetermined positive integer x—for example, the triples (12,9,15), (33,180,183), and (33,44,55). Moreover, it can be laborious to find m and n such that x = m2n2. Meanwhile, when using ( 1 ), it is enough to find all the dC(x) to obtain all Pythagorean triples. In particular, if we need to find all primitive Pythagorean triples that involve a predetermined positive integer x, then now we can use only the dC(x) that satisfy the conditions ( 2 ).

Generating triples using quadratic equations

There are several methods for defining quadratic equations for calculating each leg of a Pythagorean triple. [15] A simple method is to modify the standard Euclid equation by adding a variable x to each m and n pair. The m,n pair is treated as a constant while the value of x is varied to produce a "family" of triples based on the selected triple. An arbitrary coefficient can be placed in front of the x-value on either m or n, which causes the resulting equation to systematically "skip" through the triples. For example, consider the triple [20,21,29], which can be calculated from the Euclid equations with values m = 5 and n = 2. Also, arbitrarily put the coefficient of 4 in front of the x in the m term.

Let m1 = (4x + m), and let n1 = (x + n).

Hence, substituting the values of m and n:

The original triple comprises the constant term in each of the respective quadratic equations. Below is a sample output from these equations. The effect of these equations is to cause the m-value in the Euclid equations to increment in steps of 4, while the n-value increments by 1.

xside aside bside cmn
020212952
154729093
2104153185134
3170264314175
4252405477216

Generating all primitive Pythagorean triples using half-angle tangents

A primitive Pythagorean triple can be reconstructed from a half-angle tangent. Choose r, a positive rational number in (0, 1), to be tan A/2 for the interior angle A that is opposite the side of length a. Using tangent half-angle formulas, it follows immediately that

are both rational and that α2 + β2 = 1. Multiplying up by the smallest integer that clears the denominators of α and β recovers the original primitive Pythagorean triple. Note that if a < b is desired, then r should be chosen to be less than 2 − 1.

The interior angle B that is opposite the side of length b will be the complementary angle of A. We can calculate

from the formula for the tangent of the difference of angles. Using s instead of r in the above formulas will give the same primitive Pythagorean triple but with a and b swapped.

Note that r and s can be reconstructed from a, b, and c using r = a / (b + c) and s = b / (a + c).

Pythagorean triples by use of matrices and linear transformations

Let [a, b, c] be a primitive triple with a odd. Then 3 new triples [a1, b1, c1], [a2, b2, c2], [a3, b3, c3] may be produced from [a, b, c] using matrix multiplication and Berggren's [11] three matrices A, B, C. Triple [a, b, c] is termed the parent of the three new triples (the children). Each child is itself the parent of 3 more children, and so on. If one begins with primitive triple [3,4,5], then all primitive triples will eventually be produced by application of these matrices. The result can be graphically represented as an infinite ternary tree with [a, b, c] at the root node. An equivalent result may be obtained using Berggrens's three linear transformations shown below.

Berggren's three linear transformations are:

Alternatively, one may also use 3 different matrices found by Price. [10] These matrices A,B,C and their corresponding linear transformations are shown below.

Price's three linear transformations are

The 3 children produced by each of the two sets of matrices are not the same, but each set separately produces all primitive triples.

For example, using [5, 12, 13] as the parent yields two sets of three children:

Area proportional to sums of squares

All primitive triples with b + 1 = c and with a odd can be generated as follows: [16]

Pythagorean tripleSemi-perimeterAreaIncircle radiusCircumcircle radius
1
2
3

Height-excess enumeration theorem

Wade and Wade [17] first introduced the categorization of Pythagorean triples by their height, defined as cb, linking 3,4,5 to 5,12,13 and 7,24,25 and so on.

McCullough and Wade [18] extended this approach, which produces all Pythagorean triples when k > h2/d: Write a positive integer h as pq2 with p square-free and q positive. Set d = 2pq if p is odd, or d= pq if p is even. For all pairs (h,k) of positive integers, the triples are given by

The primitive triples occur when gcd(h,k) = 1 and either h = q2 with q odd or h=2q2.

Related Research Articles

<span class="mw-page-title-main">Diophantine equation</span> Polynomial equation whose integer solutions are sought

In mathematics, a Diophantine equation is an equation, typically a polynomial equation in two or more unknowns with integer coefficients, for which only integer solutions are of interest. A linear Diophantine equation equates to a constant the sum of two or more monomials, each of degree one. An exponential Diophantine equation is one in which unknowns can appear in exponents.

<span class="mw-page-title-main">Fibonacci sequence</span> Numbers obtained by adding the two previous ones

In mathematics, the Fibonacci sequence is a sequence in which each number is the sum of the two preceding ones. Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers, commonly denoted Fn. Many writers begin the sequence with 0 and 1, although some authors start it from 1 and 1 and some from 1 and 2. Starting from 0 and 1, the sequence begins

<span class="mw-page-title-main">Pythagorean triple</span> Integer side lengths of a right triangle

A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2. Such a triple is commonly written (a, b, c), a well-known example is (3, 4, 5). If (a, b, c) is a Pythagorean triple, then so is (ka, kb, kc) for any positive integer k. A triangle whose side lengths are a Pythagorean triple is a right triangle and called a Pythagorean triangle.

<span class="mw-page-title-main">Euler's totient function</span> Number of integers coprime to and less than n

In number theory, Euler's totient function counts the positive integers up to a given integer n that are relatively prime to n. It is written using the Greek letter phi as or , and may also be called Euler's phi function. In other words, it is the number of integers k in the range 1 ≤ kn for which the greatest common divisor gcd(n, k) is equal to 1. The integers k of this form are sometimes referred to as totatives of n.

<span class="mw-page-title-main">Factorization</span> (Mathematical) decomposition into a product

In mathematics, factorization (or factorisation, see English spelling differences) or factoring consists of writing a number or another mathematical object as a product of several factors, usually smaller or simpler objects of the same kind. For example, 3 × 5 is an integer factorization of 15, and (x – 2)(x + 2) is a polynomial factorization of x2 – 4.

In mathematics, a quadric or quadric surface (quadric hypersurface in higher dimensions), is a generalization of conic sections (ellipses, parabolas, and hyperbolas). It is a hypersurface (of dimension D) in a (D + 1)-dimensional space, and it is defined as the zero set of an irreducible polynomial of degree two in D + 1 variables; for example, D = 1 in the case of conic sections. When the defining polynomial is not absolutely irreducible, the zero set is generally not considered a quadric, although it is often called a degenerate quadric or a reducible quadric.

In linear algebra, an invertible matrix is a square matrix which has an inverse. In other words, if some other matrix is multiplied by the invertible matrix, the result can be multiplied by an inverse to undo the operation. Invertible matrices are the same size as their inverse.

In mathematics, a quadratic form is a polynomial with terms all of degree two. For example,

Toom–Cook, sometimes known as Toom-3, named after Andrei Toom, who introduced the new algorithm with its low complexity, and Stephen Cook, who cleaned the description of it, is a multiplication algorithm for large integers.

<span class="mw-page-title-main">Square root of 2</span> Unique positive real number which when multiplied by itself gives 2

The square root of 2 is the positive real number that, when multiplied by itself or squared, equals the number 2. It may be written in mathematics as or . It is an algebraic number, and therefore not a transcendental number. Technically, it should be called the principal square root of 2, to distinguish it from the negative number with the same property.

In geometry, a Heronian triangle is a triangle whose side lengths a, b, and c and area A are all positive integers. Heronian triangles are named after Heron of Alexandria, based on their relation to Heron's formula which Heron demonstrated with the example triangle of sides 13, 14, 15 and area 84.

In mathematics, the Lucas sequences and are certain constant-recursive integer sequences that satisfy the recurrence relation

In linear algebra, a rotation matrix is a transformation matrix that is used to perform a rotation in Euclidean space. For example, using the convention below, the matrix

<span class="mw-page-title-main">Pell number</span> Number used to approximate the square root of 2

In mathematics, the Pell numbers are an infinite sequence of integers, known since ancient times, that comprise the denominators of the closest rational approximations to the square root of 2. This sequence of approximations begins 1/1, 3/2, 7/5, 17/12, and 41/29, so the sequence of Pell numbers begins with 1, 2, 5, 12, and 29. The numerators of the same sequence of approximations are half the companion Pell numbers or Pell–Lucas numbers; these numbers form a second infinite sequence that begins with 2, 6, 14, 34, and 82.

Cubic reciprocity is a collection of theorems in elementary and algebraic number theory that state conditions under which the congruence x3 ≡ p (mod q) is solvable; the word "reciprocity" comes from the form of the main theorem, which states that if p and q are primary numbers in the ring of Eisenstein integers, both coprime to 3, the congruence x3p is solvable if and only if x3q is solvable.

<span class="mw-page-title-main">Pythagorean quadruple</span> Four integers where the sum of the squares of three equals the square of the fourth

A Pythagorean quadruple is a tuple of integers a, b, c, and d, such that a2 + b2 + c2 = d2. They are solutions of a Diophantine equation and often only positive integer values are considered. However, to provide a more complete geometric interpretation, the integer values can be allowed to be negative and zero (thus allowing Pythagorean triples to be included) with the only condition being that d > 0. In this setting, a Pythagorean quadruple (a, b, c, d) defines a cuboid with integer side lengths |a|, |b|, and |c|, whose space diagonal has integer length d; with this interpretation, Pythagorean quadruples are thus also called Pythagorean boxes. In this article we will assume, unless otherwise stated, that the values of a Pythagorean quadruple are all positive integers.

<span class="mw-page-title-main">Integer triangle</span> Triangle with integer side lengths

An integer triangle or integral triangle is a triangle all of whose side lengths are integers. A rational triangle is one whose side lengths are rational numbers; any rational triangle can be rescaled by the lowest common denominator of the sides to obtain a similar integer triangle, so there is a close relationship between integer triangles and rational triangles.

<span class="mw-page-title-main">Fermat's right triangle theorem</span> Rational right triangles cannot have square area

Fermat's right triangle theorem is a non-existence proof in number theory, published in 1670 among the works of Pierre de Fermat, soon after his death. It is the only complete proof given by Fermat. It has many equivalent formulations, one of which was stated in 1225 by Fibonacci. In its geometric forms, it states:

<span class="mw-page-title-main">Tree of primitive Pythagorean triples</span>

In mathematics, a tree of primitive Pythagorean triples is a data tree in which each node branches to three subsequent nodes with the infinite set of all nodes giving all primitive Pythagorean triples without duplication.

<span class="mw-page-title-main">Metallic mean</span> Generalization of golden and silver ratios

The metallic mean of a natural number n is a positive real number, denoted here that satisfies the following equivalent characterizations:

References

  1. Fibonacci, Leonardo Pisano, (1225), Liber Quadratorum.
  2. Fibonacci, Leonardo Pisano . The Book of Squares (Liber Quadratorum). An annotated translation into modern English by L. E. Sigler. (1987) Orlando, FL: Academic Press. ISBN   978-0-12-643130-8
  3. Stifel, Michael, (1544), Arithmetica Integra.
  4. Ozanam, Jacques (1814). Recreations in Mathematics and Natural Philosophy. Vol. 1. G. Kearsley. p. 49. Retrieved 2009-11-19.
  5. Ozanam, Jacques, (1844). Science and Natural Philosophy: Dr. Hutton's Translation of Montucla's edition of Ozanam, revised by Edward Riddle, Thomas Tegg, London. Read online- Cornell University
  6. Dickson, L. E. (1920), History of the Theory of Numbers, Vol.II. Diophantine Analysis, Carnegie Institution of Washington, Publication No. 256, 12+803pp Read online - University of Toronto
  7. Rukavicka, J. (2013), Dickson's Method for Generating Pythagorean Triples Revisited, European Journal of Pure and Applied Mathematics ISSN 1307-5543, Vol. 6, No. 3 (2013) p.363-364, online1 online2
  8. Horadam, A. F., "Fibonacci number triples", American Mathematical Monthly 68, 1961, 751-753.
  9. 1 2 Bernhart, Frank R.; Price, H. Lee (2005). "Heron's formula, Descartes circles, and Pythagorean triangles". arXiv: math/0701624v1 .
  10. 1 2 Price, H. Lee (2008). "The Pythagorean Tree: A New Species". arXiv: 0809.4324 [math.HO].
  11. 1 2 Berggren, B. (1934). "Pytagoreiska trianglar". Tidskrift för elementär matematik, fysik och kemi (in Swedish). 17: 129–139.
  12. Carvalho, Alda; Pereira dos Santos, Carlos (2012). "A very useful Pythagorean tree". In Silva, Jorge Nuno (ed.). Proceedings of the recreational mathematics colloquium II, University of Évora, Portugal, April 27–30, 2011. Lisboa: Associação Ludus. pp. 3–15. ISBN   9789899734623.
  13. Amato, Roberto, A characterization of Pythagorean triples, JP Journal of Algebra, Number Theory and Applications 39 (2) (2017), 221-230
  14. Amato, Roberto, A characterization of primitive Pythagorean triples, Palestine Journal of Mathematics 12 (2) (2023), 524-529.
  15. J. L. Poet and D. L. Vestal, Jr. (2005). "Curious Consequences of a Miscopied Quadratic, " College Mathematics Journal 36, 273–277.
  16. Barbeau, Edward, Power Play, Mathematical Association of America,1997, p. 51, item 3.
  17. Wade, Peter, and Wade, William, "Recursions that produce Pythoagorean triples", College Mathematics Journal 31, March 2000, 98-101.
  18. McCullough, Darryl, and Wade, Elizabeth, "Recursive enumeration of Pythagorean triples", College Mathematics Journal 34, March 2003, 107-111.