Jump to content

Formulas for generating Pythagorean triples

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Georgia guy (talk | contribs) at 22:07, 17 January 2009 (New article). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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

I., II.

Pythagoras' and Plato's formulas have been described above. The methods below appear in various sources, often without attribution as to their origin.

III.

Given an integer n, the triple can be generated by the following two procedures:[citation needed]

Example: When n = 2 the triple produced is 5, 12, and 13 (This formula is actually the same as method I, substituting m with 2n + 1.)

Alternatively, one can generate triples from even integers using the following formulas:

Example: When m = 4 the triple produced is 8, 15, and 17 (This formula is another specific case of method I, substituting n with 1).

IV.

Given the integers n and x,[citation needed]

Example: For n = 3 and x = 5, a = 80, b = 39, c = 89. (This formula is actually the same as method I, substituting m and n with n+x and x.)

V.

Triples can be calculated using this formula: , xyz > 0 where the following relations hold: (see: http://www.cut-the-knot.org/pythagoras/PT_matrix.shtml and Dantzig, Tobias. Numbers: The Language of Science, 1930, pg 54, Simon and Schuster also see:http://books.google.com/books?hl=en&id=Pg_RKtlVlNMC&dq=tobias+dantzig+%22The+Language+of+Science%22&printsec=frontcover&source=web&ots=jNcSv1E1Hv&sig=xb3-3c1cV5uSmjVawTZ3wJziJSw&sa=X&oi=book_result&resnum=4&ct=result#PPA54,M1)

x = c − b, y = c − a, z = a + b − c and a = x + z, b = y + z, c = x + y + z and r = z/2 , where x, y, and z are the three sides of the triple and r is the radius of the inscribed circle.

Pythagorean triples can then be generated by choosing any even integer z.

x and y are any two factors of .

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

z = 6, x = 18, y = 1 produces the triple a = 18 + 6 = 24, b = 1 + 6 = 7, c = 18 + 1 + 6 = 25.

z = 6, x = 2, y = 9 produces the triple a = 2 + 6 = 8, b = 9 + 6 = 15, c = 2 + 9 + 6 = 17.

z = 6, x = 6, y = 3 produces the triple a = 6 + 6 = 12, b = 3 + 6 = 9, c = 6 + 3 + 6 = 15.

VI.

Euclid's well-known formula (see Generating a triple above):

can generate an infinity by infinity matrix E of Pythagorean triples (PNTs) by making m the row number and n the column number (or vice versa). E will contain every mostly derivative (non-relatively prime) PNTs because a PNT in E will not be relatively prime (primitive) if m and n are both even, or both odd, or if they have a common factor > 1. Also, E(n,m) will be the same PNT as E(m,n), so nearly half the PNTs in E will be duplicates(but with b negative) and more than half will be derivative. And if m = n (the main diagonal), the result will be a degenerate PNT, {c, 0, c}. Below is a portion of E, with the primitive PNTs enclosed in ::s.

 2,  0,  2    ::4,  3,  5::    6,  8  10    ::8, 15, 17::   10, 24, 26    ::12, 35, 37::
 4, -3,  5      8,  0,  8   ::12,  5  13::   16, 12, 20   ::20, 21, 29::    24, 32, 40   
 6, -8, 10     12, -5, 13     18,  0  18   ::24,  7, 25::   30, 16, 34     <36, 27, 45>
 8,-15, 17     16,-12, 20     24, -7  25     32,  0, 32   ::40,  9, 41::    48, 20, 52
10,-24, 26     20,-21, 29     30,-16  34     40, -9, 41     50,  0, 50    ::60, 11, 61::
12,-35, 37     24,-32, 40     36,-27  45     48,-20, 52     60,-11, 61      72,  0, 72

Another infinity by infinity matrix M of PNTs, which has some particularly desirable properties (no duplicates, fewer derivatives, corresponding entries (a, b, c) in each row and each column increase monotonically, and each row and each column of M is a different single family of PNTs--see below)) can be generated by taking:[citation needed]

where r is the row number and k is the column number. These formulae for a, b, and c can be verified by substituting the right-hand side of each of the above equations into

Squaring out the above expressions (and inserting periods in the first two to make like terms line up) gives us:

.............._________________________________________________________________________________________________

Note that always, a is doubly even, b and c are odd.

A one-to-one mapping can be established between all of M and those PNTs of E for which one of {m,n} is even, the other is odd, and m > n:

therefore all primitive PNTs are in M, albeit many derivative PNTs in E are not in M.

Most of the PNTs in M will have a < b; a > b will occur only when r < (k√2+1)/2

Since (k√2+1) is never an integer, therefore r = (k√2+1)/2 can't occur; if r > (k√2+1)/2, which it is for all but a finite number (< k, if k > 2) of PNTs in column k, a < b.

Each row is a family of PNTs with the hypotenuse c of each PNT in row r exceeding the even side a by the square of the rth odd number.

= the square of the rth odd number.

The Pythagorean formula for generating PNTs (section I, above) with a and b reversed to make a the even side, and m being any natural number:

yields the first row (r = 1) of M, and the Platonic formula (section II, above) using a = 4m instead of 2m, to eliminate derivative PNTs:

yields the first column (k = 1) of M.

Each column is a family of PNTs with the hypotenuse of each PNT in column k exceeding the odd side b by twice the square of k. For example M(6,4) = {120, 209, 241} 241 − 120 = 121, the square of the sixth odd number (11), and 241 − 209 = 32, twice the square of 4.

Below is a small portion of the matrix. The PNTs of row 1 are all relatively prime (primitive), but every other row contains derivative (not relatively prime) PNTs. Iff the column number is a power of 2, the PNTs in that column are all primitive. For every odd prime factor p of the column number, the middle row of each group of p rows (r = (p+1)/2 + np, where n >= 0) will contain a PNT which is derivative. In the table below these are indicated by angle brackets. If j is 2 or a factor of k, then M(r, jk) is derivative if and only if M(r, k) is derivative. Fewer than 20% of the PNTs in M are derivative.

  column-> 1                2                3                4                5
row   a    b    c      a    b    c      a    b    c      a    b    c      a    b    c
 1    4    3    5     12    5   13     24    7   25     40    9   41     60   11   61
 2    8   15   17     20   21   29    <36   27   45>    56   33   65     80   39   89
 3   12   35   37     28   45   53     48   55   73     72   65   97   <100   75  125>
 4   16   63   65     36   77   85     60   91  109     88  105  137    120  119  169
 5   20   99  101     44  117  125    <72  135  153>   104  153  185    140  171  221
 6   24  143  145     52  165  173     84  187  205    120  209  241    160  231  281
 7   28  195  197     60  221  229     96  247  265    136  273  305    180  299  349
 8   32  255  257     68  285  293   <108  315  333>   152  355  373   <200  375  425>

The a's of each column k are an arithmetic sequence with difference 4k, and the b's of each row r are an arithmetic sequence with difference 4r-2. The a's, b's, and c's of any row or column are each monotonically increasing:

If the two legs of a PNT differ by 1, the longer leg and the hypotenuse form the coordinates of a larger PNT in M the legs of which differ by 1. M(1,1) = {4, 3, 5}, M(4,5) = {120, 119, 169}, M(21,29) = {4060, 4059, 5741}, M(120,169) = {137904, 137903, 195025}, etc. Note that this gives only PNTs where a > b, but Sierpinski (2003) gives a formula for finding near-isosceles PNTs which alternately gives a = b+1 and b = a+1. Thus, a Pythagorean triangle can be found, the acute angles of which are arbitrarily close (but never equal) to 45 degrees. As Martin (1875) describes, each such triple has the form

where are the Pell numbers.

VII.

Generalized Fibonacci Series:

A primitive Pythagorean triangle (triple) can be generated using any two coprime positive integers by the following procedure: [1] Start with a 2 × 2 array (a "Fibonacci Box") 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:

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, q' are not coprime, the same procedure leads to a non-primitive triple.

VIII.

Progression of Whole and Fractional Numbers: (see: http://books.google.com/books?id=s_IJAAAAMAAJ&pg=RA3-PA49&lpg=RA3-PA49&dq=%22progression+of+whole+and+fractional+numbers%22&source=bl&ots=oqTStsEhjm&sig=ijq_0_4OpZRM0llJGzM7Jjz4Jec&hl=en&sa=X&oi=book_result&resnum=2&ct=result or "Recreations in Mathematics and Natural Philosophy by By Jacques Ozanam, Volume1, 1814, page 49).

Take a progression of whole and fractional numbers: 1 1/3, 2 2/5 , 3 3/7 , 4 4/9 etc. The properties of this progression are: a) the whole numbers are those of the common series and have unity as their common difference b) the numerators of the fractions, annexed to the whole numbers, are also the natural numbers. 3) the denominators of the fractions are the odd numbers, 3,5,7, etc.

To calculate a pythagorean triple:

select any term of this progression and reduce it to an improper fraction. For example, take the term 3 3/7. The improper fraction is 24/7. The numbers 7 and 24 are the sides, a and b, of a right triangle. The hypotenuse is one greater than the largest side.

1 1/3 yields the 3,4,5 triple; 2 2/5 gives 5,12,13 ; 3 3/7 yields gives 7,24, 25 ; 4 4/9 gives 9,40,41 and so forth.

IX.

Generating Triples using a Square:[citation needed]

Start with any square number . Express that number in the form , then will produce another square such that . For instance:

let , , , and .

let , , , and .

This works because . If we add , our expression becomes , which factors into the form .

Source: "Sequence A129861 in The On-Line Encyclopedia of Integer Sequences". Online Encyclopedia of Integer Sequences. N. J. A. Sloane. May 23 2007. Retrieved 2008-10-18. {{cite web}}: Check date values in: |date= (help)

X.

Generating Triples When One Side is Known: (this method is a direct algebraic manipulation of the Euclid equations).

Start with any integer . Use this relation from the Euclid formula: . If is odd, then multiply by 2. Identify all factor-pairs (m,n) of and use the Euclid equations to calculate the remaining sides of the triple.

Examples: Let =24 (e.g. the known side is even)

so that . The factor pairs (m,n) of 12 are (12,1), (6,2) and (4,3). The three possible triples are therefore:

Let =35 (e.g. the known side is odd)

The two unknown sides could also be calculated by making use of the relation . This would be a factoring exercise in finding the difference of two squares, but a simpler approach is to multiply the known side by two and continue as before :

so that . The factor pairs (m,n) of 35 are (35,1), (7,5).

The two triples are therefore (note that is necessary to remove the factor of 2 which was introduced):

XI.

Generating Triples Using Quadratic Equations: (see: http://learn.sdstate.edu/vestald/publications/Curious%20Consequences.pdf and http://mathcentral.uregina.ca/mp/previous2005/feb06sol.php )

There are several methods for defining quadratic equations for calculating each leg of a Pythagorean triple. 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 has the effect causing the resulting equation to systematically “skip” through the triples. For example, let’s use the triple 20,21, 29, when can be calculated from the Euclid equations with a value of m=5 and n=2. Also, let’s arbitrarily put the coefficient of 4 in front of the “x” in the “m” term.

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

Hence, substituting the values of m and n:

Note that the original triple comprises the constant term in each of the respective quadratic equations. Below is a sample output from these equations. Note that 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.

               x     side a       side b      side c     m  n    
               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
  1. ^ Price, H. Lee (2008), The Pythagorean Tree: A New Species, arXiv.org/abs/0809.4324v1