Formulas for generating Pythagorean triples

From testwiki
Jump to navigation Jump to search

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

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

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

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

Fibonacci's method

Leonardo of Pisa (Template:Circa) described this method[1][2] for generating primitive triples using the sequence of consecutive odd integers 1,3,5,7,9,11, and the fact that the sum of the first Template:Mvar terms of this sequence is n2. If Template:Mvar is the Template:Mvar-th member of this sequence then n=(k+1)/2.

Choose any odd square number Template:Mvar from this sequence (k=a2) and let this square be the Template:Mvar-th term of the sequence. Also, let b2 be the sum of the previous n1 terms, and let c2 be the sum of all Template:Mvar terms. Then we have established that a2+b2=c2 and we have generated the primitive triple Template:Math. This method produces an infinite number of primitive triples, but not all of them.

EXAMPLE: Choose k=9=32=a2. This odd square number is the fifth term of the sequence, because 5=n=(a2+1)/2. The sum of the previous 4 terms is b2=42 and the sum of all n=5 terms is c2=52 giving us a2+b2=c2 and the primitive triple Template:Math.

Sequences of mixed numbers

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

113[3,4,5],225[5,12,13],337[7,24,25],449[9,40,41],

Jacques Ozanam[5] republished Stifel's sequence in 1694 and added the similar sequence 178,21112,31516,41920, with an=n+4n+34n+4. 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, Template:Mvar and Template:Mvar, of a right triangle, and the hypotenuse is Template:Math. For example:

178[8,15,17],21112[12,35,37],31516[16,63,65],41920[20,99,101],

With Template:Mvar the shorter and Template:Mvar the longer legs of a triangle and Template:Mvar its hypotenuse, the Pythagoras family of triplets is defined by Template:Math, the Plato family by Template:Math, and the Fermat family by Template:Math. 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 x2+y2=z2, find positive integers Template:Mvar, Template:Mvar, and Template:Mvar such that r2=2st is a perfect square. Then:

x=r+s,y=r+t,z=r+s+t.

From this we see that Template:Mvar is any even integer and that Template:Mvar and Template:Mvar are factors of Template:Math. All Pythagorean triples may be found by this method. When Template:Mvar and Template:Mvar 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 Template:Math. Then Template:Math. 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.

Template:Math, Template:Math produces the triple Template:Math because Template:Math, Template:Math, Template:Math.
Template:Math, Template:Math produces the triple Template:Math because Template:Math, Template:Math, Template:Math.
Template:Math, Template:Math produces the triple Template:Math because Template:Math, Template:Math, Template:Math. (Since Template:Mvar and Template:Mvar are not coprime, this triple is not primitive.)

Generalized Fibonacci sequence

Method I

For Fibonacci numbers starting with Template:Math and Template:Math and with each succeeding Fibonacci number being the sum of the preceding two, one can generate a sequence of Pythagorean triples starting from Template:Math via

(an,bn,cn)=(an1+bn1+cn1,F2n1bn1,F2n)

for Template:Math.

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 Template:Math and Template:Math, if Template:Math and Template:Math, then

(2hn+1hn+2,hnhn+3,2hn+1hn+2+hn2)

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 Template:Math in the top row. Place the even integer (if any) in the Template:Nowrap column.

[qq]

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

q+q=pq+p=p[qqpp]

Such an array may be called a "Fibonacci Box". Note that Template:Math is a generalized Fibonacci sequence. Taking column, row, and diagonal products we obtain the sides of triangle Template:Math, its area Template:Mvar, and its perimeter Template:Mvar, as well as the radii Template:Math of its incircle and three excircles as follows:

a=2qpb=qpc=ppqq=qp+qpradii(r1=qq,r2=qp,r3=qp,r4=pp)A=qqppP=r1+r2+r3+r4

The half-angle tangents at the acute angles are Template:Math and Template:Math.

EXAMPLE:

Using coprime integers 9 and 2.

[29][291113]

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

a=2(22)=44b=117c=(14318)=(26+99)=125radii(r1=18,r2=26,r3=99,r4=143)A=18(143)=2574P=(18+26+99+143)=286

The half-angle tangents at the acute angles are 2/11 and 9/13. Note that if the chosen integers Template:Mvar and Template:Math 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]

(k1+k2+k3+k4)2=2(k12+k22+k32+k42),

where integer curvatures Template:Math are obtained by multiplying the reciprocal of each radius by the area Template:Mvar. The result is Template:Math, Template:Math, Template:Math, Template:Math. Here, the largest circle is taken as having negative curvature with respect to the other three. The largest circle (curvature Template:Math) may also be replaced by a smaller circle with positive curvature ( Template:Math).

EXAMPLE:

Using the area and four radii obtained above for primitive triple Template:Math, we obtain the following integer solutions to Descartes' Equation: Template:Math, Template:Math, Template:Math, Template:Math, and Template:Math.

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 Template:Mvar and Template:Mvar in the right-hand column.

[xy]

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

[xy],[xy],[yx]

resulting in three more valid Fibonacci boxes containing Template:Mvar and Template:Mvar. We may think of the first Box as the "parent" of the next three. For example, if Template:Math and Template:Math we have:

[1123]parent
[2135],[1345],[3147]children

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 Template:Mvar 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. Template:NumBlk with

dC(x):={D(x)if x is oddD(x)P(x)if x is even,

where

D(x)={d dx and d divides x2},

and if Template:Mvar is even with Template:Math, Template:Math, and Template:Math odd fixed, with

P(x)={dd=2sl and l divides x2 and s{1,2,...,2n1}}.

That is, regarding Template:Math, Template:Mvar must be even and such that Template:Math is still divisible by Template:Math.

Moreover, Template:Math is a primitive Pythagorean triple if both of the following conditions are verified:[14]

Template:NumBlk

EXAMPLES

Template:Math, Template:Math
for Template:Math Template:Math Template:Math Template:Math primitive
for Template:Math Template:Math Template:Math Template:Math
for Template:Math Template:Math Template:Math Template:Math
for Template:Math Template:Math Template:Math Template:Math primitive
for Template:Math Template:Math Template:Math Template:Math trivial
Template:Math, Template:Math
for Template:Math Template:Math Template:Math Template:Math primitive
for Template:Math Template:Math Template:Math Template:Math
for Template:Math Template:Math Template:Math Template:Math
for Template:Math Template:Math Template:Math Template:Math primitive
for Template:Math Template:Math Template:Math Template:Math trivial

We remember that the Euclid’s formulas do not give all Pythagorean triples that involves a predetermined positive integer Template:Mvar, for example, the triples Template:Math, Template:Math, and Template:Math. Moreover, it can be laborious to find Template:Mvar and Template:Mvar such that Template:Math. Meanwhile, when using (Template:EquationNote), it is enough to find all the Template:Math to obtain all Pythagorean triples. In particular, if we need to find all primitive Pythagorean triples that involve a predetermined positive integer Template:Mvar, then now we can use only the Template:Math that satisfy the conditions (Template:EquationNote).

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 Template:Mvar to each Template:Mvar and Template:Mvar pair. The Template:Math pair is treated as a constant while the value of Template:Mvar is varied to produce a "family" of triples based on the selected triple. An arbitrary coefficient can be placed in front of the Template:Mvar-value on either Template:Mvar or Template:Mvar, which causes the resulting equation to systematically "skip" through the triples. For example, consider the triple Template:Math, which can be calculated from the Euclid equations with values Template:Math and Template:Math. Also, arbitrarily put the coefficient of 4 in front of the Template:Mvar in the Template:Mvar term.

Let Template:Math, and let Template:Math.

Hence, substituting the values of Template:Mvar and Template:Mvar:

Side A=2m1n1=2(4x+5) (x+2)=8x2+26x+20Side B=m12n12=(4x+5)2(x+2)2=15x2+36x+21Side C=m12+n12=(4x+5)2+(x+2)2=17x2+44x+29

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 Template:Mvar-value in the Euclid equations to increment in steps of 4, while the Template:Mvar-value increments by 1.

Template:Mvar side Template:Mvar side Template:Mvar side Template:Mvar Template:Mvar Template:Mvar
0 20 21 29 5 2
1 54 72 90 9 3
2 104 153 185 13 4
3 170 264 314 17 5
4 252 405 477 21 6

Generating all primitive Pythagorean triples using half-angle tangents

A primitive Pythagorean triple can be reconstructed from a half-angle tangent. Choose Template:Mvar, a positive rational number in Template:Math, to be Template:Math for the interior angle Template:Mvar that is opposite the side of length Template:Mvar. Using tangent half-angle formulas, it follows immediately that

α=sin(A)=2r1+r2 and β=cos(A)=1r21+r2

are both rational and that Template:Math. Multiplying up by the smallest integer that clears the denominators of Template:Mvar and Template:Mvar recovers the original primitive Pythagorean triple. Note that if Template:Math is desired, then Template:Mvar should be chosen to be less than Template:Tmath.

The interior angle Template:Mvar that is opposite the side of length Template:Mvar will be the complementary angle of Template:Mvar. We can calculate

s=tan(B2)=tan(π4A2)=1r1+r

from the formula for the tangent of the difference of angles. Using Template:Mvar instead of Template:Mvar in the above formulas will give the same primitive Pythagorean triple but with Template:Mvar and Template:Mvar swapped.

Note that Template:Mvar and Template:Mvar can be reconstructed from Template:Mvar, Template:Mvar, and Template:Mvar using Template:Math and Template:Math.

Pythagorean triples by use of matrices and linear transformations

Template:Main article

Let Template:Math be a primitive triple with Template:Mvar odd. Then 3 new triples Template:Math, Template:Math, Template:Math may be produced from Template:Math using matrix multiplication and Berggren's[11] three matrices Template:Mvar, Template:Mvar, Template:Mvar. Triple Template:Math 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 Template:Math, 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 Template:Math at the root node. An equivalent result may be obtained using Berggrens's three linear transformations shown below.

[122212223]A[abc]=[a1b1c1], [122212223]B[abc]=[a2b2c2], [122212223]C[abc]=[a3b3c3]

Berggren's three linear transformations are:

a+2b+2c=a12a+b+2c=b12a+2b+3c=c1[ a1, b1, c1]+a+2b+2c=a2+2a+b+2c=b2+2a+2b+3c=c2[ a2, b2, c2]+a2b+2c=a3+2ab+2c=b3+2a2b+3c=c3[ a3, b3, c3]

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

[211222213]A[abc]=[a1b1c1], [211222213]B[abc]=[a2b2c2], [211222213]C[abc]=[a3b3c3]

Price's three linear transformations are

+2a+bc=a12a+2b+2c=b12a+b+3c=c1[ a1, b1, c1]+2a+b+c=a2+2a2b+2c=b2+2ab+3c=c2[ a2, b2, c2]+2ab+c=a3+2a+2b+2c=b3+2a+b+3c=c3[ a3, b3, c3]

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:

[5,12,13]ABC[45,28,53][55,48,73][7,24,25][5,12,13]ABC[9,40,41][35,12,37][11,60,61]

Area proportional to sums of squares

All primitive triples with Template:Math and with Template:Mvar odd can be generated as follows:[16]

Pythagorean triple Semi-perimeter Area Incircle radius Circumcircle radius
(3,4,5) 1+2+3 6×(12) 1 52
(5,12,13) 1+2+3+4+5 6×(12+22) 2 132
(7,24,25) 1+2+3+4+5+6+7 6×(12+22+32) 3 252
(a,a212,a2+12) 1+2++a 6×[12+22++(a12)2] a12 a2+14

Height-excess enumeration theorem

Wade and Wade[17] first introduced the categorization of Pythagorean triples by their height, defined as Template:Math, 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 Template:Math: Write a positive integer Template:Mvar as Template:Math with Template:Mvar square-free and Template:Mvar positive. Set Template:Math if Template:Mvar is odd, or Template:Math if Template:Mvar is even. For all pairs Template:Math of positive integers, the triples are given by

(h+dk,dk+(dk)22h,h+dk+(dk)22h).

The primitive triples occur when Template:Math and either Template:Math with Template:Mvar odd or Template:Math.

References

Template:Reflist

  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. Template:ISBN
  3. Stifel, Michael, (1544), Arithmetica Integra.
  4. Template:Cite book
  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. 9.0 9.1 Template:Cite arXiv
  10. 10.0 10.1 Template:Cite arXiv
  11. 11.0 11.1 Template:Cite journal
  12. Template:Cite book
  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.