Pythagorean Triples

abc
101
345
51213
72425
94041
116061
138485
15112113
17144145
19180181
21220221
23264265
25312313
27364365
29420421
31480481

"Pythagorean triples" are integer solutions to the Pythagorean Theorem, a2 + b2 = c2. I like "triplets," but "triples" seems to be the favored term. For a right triangle, the c side is the hypotenuse, the side opposite the right angle. The a side is the shorter of the two sides adjacent to the right angle. The first rules that I became aware of for determining a subset of Pythagorean triplets are as follows:

Here, a and c are always odd; b is always even. These relationships hold because the difference between successive square numbers is successive odd numbers. Every odd number that is itself a square (and the square of every odd number is an odd number) thus makes for a Pythagorean triplet. Thus, the square of 7, 49, is the difference between 576, the square of 24, and 625, the square of 25, giving us the triplet 7,24,25. Similarly, the square of 23, 529, is the difference between 69696, the square of 264, and 70225, the square of 265, giving us the triplet 23,264,265.

The simplest triplet in the table, 1,0,1, is not a triangle, and a>b, but it is a solution to the Pythagorean Theorem -- a very trival one since n,0,n, where n is any number, works just as well (using 0 would even allow us to break Fermat's Last Theorem).

These relationships came to my attention through an appendix to Fermat's Enigma, by Simon Singh (Walker and Company, 1997, p. 293), which gives Euclid's proof that there are an infinite number of Pythagorean triplets -- basically because there are an infinite number of odd numbers. Singh's book also gives (pp. 287-288) an elegant proof of the Pythagorean Theorem itself. Thus, in the diagram at left, the area of the entire square is
(a + b)2, the area of each triangle is 1/2 ab, and the area of the inner square is c2. The area of the entire square is thus also 4(1/2 ab) + c2, so we can say that (a + b)2 = 4(1/2 ab) + c2. This multiplies out to
a2 + 2ab + b2 = 2ab + c2. Simplifying, we get a2 + b2 = c2, which is what we wanted to prove.

The fact that the difference between successive squares is successive odd numbers suggests comparison to another Pythagorean discovery, that every square is the sum of two successive triangular numbers, where the triangular numbers are the successive sums of all integers:  0 + 1 = 1, 0 + 1 + 2 = 3, 0 + 1 + 2 + 3 = 6, etc. So the triangular numbers are 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, etc. 105 + 120 = 225; 225 is the square of 15. The way this relationship can be illustrated is shown at left:  As every square can be divided into two triangles, so can every square number, which can be mapped as a square, be divided into two triangular numbers, which can be mapped as triangles. The square 25 can thus be divided into the triangles 10 and 15.

abc
202
435
6810
81517
102426
123537
144850
166365
188082
2099101
22120122
24143145
26168170
28195197
30224226
32255257
34288290
36323325
38360362
40399401
42440442
44483485
46528530
48575577
50624626
52675677
54728730
56783785
58840842
60899901
62960962
6410231025
It was originally pointed out to me by Matthew Q. Boeke that there are Pythagorean triplets in which the a side is an even number. An infinite series of Pythagorean solutions can be generated with the following rule:

In the table, we see the interesting result that for triplets where a is not evenly divisible by 4, the numbers are all even. These are simply multiples by 2 of triplets in the table above where a is odd. As such they do not seem to be considered fundamental triplets. The triplet 4,3,5 is noteworthy as having a>b, but if we reverse 4 & 3, we just have the classic 3,4,5 triplet in the odd series above.

I was aware that there were many other triplets, e.g. 20,21,29; 28,45,53; and 36,77,85, which do not obey the rule for b and c in the even series. I found these generated with matrices on the Internet, but that is a very technical presentation, and I wanted to see simpler rules for them -- my purpose in these pages not being to present mathematical matters in the standard way, which lost me back in the 11th grade, but in a way that I find interesting. This may or may not be helpful or of interest to others, but I imagine that there may be at least a few like myself who are not really mathophobes but who find the way real mathematicians explain things exasperating.

Happily, Juan Tolosa, from Richard Stockton College, Pomona, New Jersey, sent me [December 2001] formulas for all Pythagorean triplets:

Here p and q must be odd integers, with p > q, and with no common divisors. This doesn't always work as expected. For instance, with 8, 15, 17, using p=5 and q=3, the a term in the equations gives the b side and the b term the a side.

Then Juan sent along an alternative version of the equations:

Here there are similar qualifications for p and q, except that now also they cannot both be odd. For 8, 15, 17, we now use p=4 and q=1. This preserves a as a (2*4*1=8) and b as b (42 -1 = 15).

All this was more like what I was looking for.

The rules above that every odd number and every even number gives the a side of a Pythagorean triplet are special cases of these general rules. The first table above can be derived from [n,1] for p,q where n is any odd number greater than 1. We get every other line (the primitive triplets) in the second table with [n,1] for p,q where n is any even number. But all the entries in either table can be derived from either general rule. Thus, 3,4,5 comes from [3,1] or [2,1], although the order for [2,1] is then 4,3,5. The triplet 7,24,25 in the first table can be derived from [7,1] through the first rule and from [4,3] by the second rule. Similarily, the triplet 16,63,65 in the second table can be derived from [8,1] through the second rule and from [9,7] by the first rule. The non-primitive triplets in the second table can be derived by breaking the rules slightly. Thus [4,2] consists of two even numbers. This is prohibited for the second general rule because 4 and 2 share a factor of 2. [4,2], however, does produce the triplet 8,6,10. This can be reduced to 4,3,5, derived from [2,1] -- where [4,2] has been reduced by the common factor of 2. A triplet that occurs in neither table would be 20,21,29, from [7,3] by the first rule and [5,2], in the different order, by the second rule.

Just to check, we can put the first general rule into the Pythagorean Theorem itself, as at left. Here it doesn't make any difference which of the smaller quantities is a and which is b, since it is simply their sum that is the square of c. The fourth power terms that we get all cancel each other out, and we end up with a nice equality between the p and q terms. A similar test can be run with the second general rule for triplets.

What is less intuitive in these tests is why only odd numbers work for the first rule and not for the second.

As it happens, a similar problem of odds and evens comes to my attention. It is part of the demonstration formulated by the Pythagoreans that the square root of 2 is an irrational number. The argument goes like this:  If the 2 is rational, then it can be expressed as the ratio of integers p/q (since that is what "rational" means for numbers). If that ratio is at the lowest factors, then at least one number must be odd, since otherwise both could be divided by the factor of 2. Now, if 2 = p/q, then 2q2 = p2. This means that p2 is even; and if p2 is even, then p is even, since every even square is the square of an even number. That is true because odd numbers do not contain the factor 2, and so multiplying them by themselves will not introduce it. If p is even, then q must be odd. However, if p is even, then it can be expressed as 2r; and this means, by substitution, that 2q2 = 4r2. This means that q2 = 2r2, which makes q2 and so q even. But q cannot be both odd and even, so the 2 is not a rational number.

With the rules for Pythagorean triplets, where a = 2pq, a must be even. B and c will then be odd. C alone could not be even because an odd number (b2) added to an even number (a2) produces an odd number. If they were all even, then a, b, and c could all be divided by 2 and it would not be a primitive triplet. But if b and c are both odd, then p and q cannot be both even or both odd, or the differences and the sums of p2 and q2 would not be odd (evens added to evens and odds to odds are both even). Therefore, where a = 2pq, p and q are neither both even nor both odd.

Where a = pq, b and c both result from division by 2 and so p2 - q2 and p2 + q2 both must be even (if we are to have an integer result). For them to be even, p and q must either both be even or both be odd (for the sum and difference to be even). Since the squares of even numbers are always multiples of 4, and the sums of multiples of 4 will always be multiples of 4, if both p and q are even, then c, having been divided by 2, will still be even. But, as noted above, c can never be even in a primitive Pythagorean triplet. Therefore, p and q are both odd, which is the requirement for a = pq.

pqabcpq
3134521
538151741
515121332
7512353761
7320212952
717242543
9716636581
9528455372
9327364563
919404154
pqabcpq
1192099101101
11736778592
11548557383
11333566574
11111606165
131124143145121
13944117125112
1376091109103
13565729794
13339808985
13113848576
The tables at left and right give 21 sets of Pythagorean triplets. These are based on p for all odd numbers from 3 to 13. Each larger odd number has an additional odd number than is smaller than it, so there is an extra triplet for each successive odd number. The odd p and q are given on blue in the left columns, then the triplet in the middle columns on gray, and the odd/even p and q on green in the right columns.

All these small odd numbers are prime, except 9. The [9,3] line is the only non-primitive triplet, and it is marked in red, but included for sake of completeness. What is otherwise noteworthy is that the odd/even p and q always add up to the odd p, while the odd q is always the difference between the odd/even p and q. Going down the table, the odd/even q increases by one as the p decreases by one, until they only differ by one. Which is even and which is odd changes from line to line.

Fermat's Last Theorem (from Pierre de Fermat, 1607-1665), recently proven (by Andrew Wiles, 1994), is that there are no integer solutions to equations like the Pythagorean Theorem to the third power or higher, e.g. a3 + b3 = c3. Fermat said that he had a simple proof of this, but the proof eventually produced is scores of pages of the densest and most esoteric material that modern mathematics has to offer. I wondered if there were integer solutions to the three dimensional version of the Pythagorean Theorem, i.e. x2 + y2 + z2 = r2. I doubted that there were, but now D.J. Kuik of the Free University of Amsterdam has pointed out to me that any Pythagorean triplet where a or b is itself c in another triplet would make for a Pythagorean "quadruplet." Thus, in the triplet 52 + 122 = 132, 52 can be analyzed as 32 + 42. So we get the "quadruplet" 32 + 42 + 122 = 132.

There is also, of course, the four dimensional version of the Pythagorean Theorem, i.e. the Separation Formula in Relativity, t2 - (x2 + y2 + z2)/c2 = s2. Integer solutions are not to be found here unless the velocity of light (c) is itself set to an integer value, i.e. 1, which would mean that units of time could be years and units of distance are light-years (or seconds and light-seconds). To that we certainly can have integer solutions if we replace x2 + y2 + z2 with its equivalent, r2. With t2 - r2 = s2 we simply have a version of the Pythagorean Theorem itself. Otherwise we will need a Pythagorean "quintuplet."

In fact, there will be such things, for instance 32 + 42 + 122 + 842 = 852. If c = 1, we can give a solution of t2 - (x2 + y2 + z2) = s2 as 852 - (32 + 42 + 122) = 842. The "separation," s, in units of time, is, of course, smaller than the magnitude of the temporal dimension, t, because of the Reltivistic effect of time dilation.

Thus, with Pythagorean "quadruplets" and "quintuplets," we have integer solutions to the three and four dimensional versions of the Pythagorean Theorem. Other quintuplets would be 162 + 632 + 722 + 47042 = 47052 and 82 + 152 + 1442 + 105122 = 105132. Each of the quintuplets cited here requires three sets of interlocking Pythagorean triplets,
xyh
345
hzr
51213
rst
138485
xyhxyh
16636581517
hzrhzr
65729717144145
rstrst
97470447051451051210513
which are displayed in the tables at left and right. As in the diagram, x, y, z, and t are used for the coordinates of space and time. The letter h is used for the hypotenuse of a triangle using the first triplet. Then r is used for the radius of the three dimensional figure where the smallest number of the second triplet is replaced by its equivalent from the first triplet. Finally, s is the space-time separation that can be expressed when the whole quintuplet has been assembled. In the table at right, only half the triplets appear in the tables above.

Interesting in realation to all this are the theorems, proven by Fermat, that (1) any prime number of the form 4n + 1 can be expressed a sum of two squares; and (2) that such a prime is the hypotenuse of a Pythagorean Triplet, i.e. its square is the sum of two squares, (3) its square is the hypotenuse of two Pythagorean Triplets, and (4) its cube is the hypotenuse of three Pythagorean Triplets. Thus,

  1. 5 = 22 + 12,
  2. 52 = 32 + 42,
  3. 54 = 252 = 152 + 202 = 72 + 242, and
  4. 56 = 1252 = 752 + 1002 = 352 + 1202 = 442 + 1172.

The principle that certain primes are the sum of squares fits with one of the equations that generates triplets:  c = p2 + q2. Thus, the numbers which, squared and added, produce a prime, can be found here as p and q. In the table above, c includes the prime numbers 5, 13, 17, 29, 37, 41, 53, 61, 73, 89, 97, 101, 109. These prime numbers all have the noteworthy feature that they are not prime if we take into account complex factors.

pqrsabc
1123345
123551213
2358163034
35813398089
581321105208233
8132134272546610
In the table at right, Pythagorean triplets are generated from successive Fibonacci numbers, p, q, r, s, according to the following rules:

This does not seem to produce all the triplets, and we get two results here where the triplets can be divided by two, giving us 8, 15, 17 and 136, 273, 305. It looks like this will happen when p and s are even.

This characteristic of Pythagorean triplets, and more, I've found in The Teaching Company's "An Introduction to Number Theory," with lectures by Edward B. Burger, of Williams College. Curiously, while Burger devotes considerable attention to matters addressed in these pages, such as the triplets, the Golden Ratio and Fibonacci numbers, triangular numbers, and continued fractions, his comprehensive survey of Number Theory mentions, but does not directly address or treat, the category of imaginary numbers. This is especially striking in that, despite all the attention given to prime numbers and the importance attributed to them, we do not learn that many traditional primes, like 2 and 5, can be factored into complex numbers:  i.e. (1 + i)(1 - i) and (2 + i)(2 - i), respectively. I would have expected this intriguing circumstance to excite some curiosity in any treatment of Number Theory; but it seems to be characteristic of the ambivalent attitude of mathematicians to imaginaries.

Mathematics & Music, after Pythagoras

Triangular Numbers

Philosophy of Science, Mathematics

History of Philosophy, Greek

Home Page

Copyright (c) 1998, 2000, 2001, 2002, 2006, 2008, 2011 Kelley L. Ross, Ph.D. All Rights Reserved

Imaginary Powers of Euler's
or Napier's Constant

The equations at right for the ordinary circular sine and cosine functions, which are periodic, contrast with the equations for hyperbolic sine and hyperbolic cosine functions, which are not periodic. The results of all the equations are real numbers; but for the sine and cosine we have imaginary powers of e -- Euler's (after Leonhard Euler, 1707-1783) or Napier's (after John Napier, 15501617, the man who originated logarithms) Constant -- now usually called simply e alone, or the "base of natural logarithms." For the sine function, these imaginary powers are divided by the imaginary number itself.

These relationships go back to Euler's Theorem:    The equation for hyperbolic functions analogous to Euler's Theorem is:   Note that all of these equations only work when using radian measure for angles. Thus 180o is radians, and 90o is /2 radians. From this comes one famous solution to Euler's Theorem:   This occurs because the sine of 180o ( radians) is zero, which eliminates the imaginary term, while the cosine of 180o is minus one, which provides the whole value of the expression.

The idea of the imaginary power of a number is very strange. And the idea that the higher powers of a number end up repeating the lower powers is also very counter-intuitive. These phenomena can be investigated, however, using the continued series for Euler's or Napier's Constant (e). The basic series is simple and elegant. The power of e occurs as the numerator on the series of continued fractions, raised to the power of succeeding integers, starting with zero, while the denominator of the fractions is the factorial of the same integers. E to the given power is the sum of the series. Since factorials get large very quickly (13! is already 6,227,020,800), not much of the series needs to be completed to get very accurate numbers. The series will always begin with  l + x ; but I have included  x0/0!  and  x1/1!  in order to show that the first two terms are generated by the same principle as the following ones.

Where the power of e is negative (reciprocals of e), the series is modified as at right. Every other term becomes negative, since the even power of a negative number is positive, while the odd power of a negative number is negative.

With the series for the powers of e and that for the reciprocals, we can add them together and produce the numerator for the series of the hyperbolic cosine. All of the fractions with even powers are retained. They are doubled, but then the series is to be divided by 2 to get the function, which is:  

The hyperbolic sine will come from subtracting rather than adding the reciprocal series. This eliminates all the fractions with even powers in the series. All the fractions with odd powers are multiplied by 2, but, again, the series is to be divided by two to get the hyperbolic sine, which will be as follows:    The series of fractions for the hyperbolic sine and hyperbolic cosine are thus simple, elegant, and memorable. Since the terms are all added, it is obvious why the functions should increase continuously to infinity, which is characteristic of hyperbolic functions.

The circular functions, the ordinary sine and cosine, involve imaginary powers of e. The series of the simple powers of e is now modified by the power of the imaginary number, i. Multiplied by itself (i.e. squared), i becomes -1. Multiplied by itself again (i.e. cubed), that becomes -i. Multiplied by itself again (i.e. to the fourth power), that becomes simply 1. E to the fifth power is then just i again, and the cycle is repeated through the higher powers. E to the zero power falls in the cycle (before i) where its value should be 1; and, indeed, if the zero power of any number is 1, then it should be. The series for powers of e that results with powers of i may be seen at left. The odd powers now all contain i themselves. The distribution of positive and negative terms, however, is now very different from what we saw above. We have two positive terms (for 1 and i) followed by two negative terms (for -1 and -i). Then the cycle repeats.

For the negative imaginary powers of e, we take the imaginary series and multiply every odd power by -1, just as in the simple negative power series above. The sign of every fraction with an odd power will thus change from our simple imaginary power series. The result is that we still have a series with two positive terms followed by two negative terms, but now the cycle has been moved up one and the whole series begins with just one positive term.

With the series for the imaginary powers of e and that for the negative (reciprocal) powers, we can add them together and produce the numerator for the series of the cosine function. All of the fractions with even powers are retained. They are doubled, but then the series is to be divided by 2 to get the function, which is:   The conspicuous feature about this series, in comparison to that for the hyperbolic cosine, is that the terms are alternatively positive and negative, while the terms in the hyperbolic function were all positive. That is actually the only difference.

The sine function will come from subtracting rather than adding the reciprocal series. This eliminates all the fractions with even powers in the series. All the fractions with odd powers are multiplied by 2. All the fractions with odd powers also retain their imaginary part. So the series must be divided, not just by two, like the previous series, but by i also to get the sine, which will be as follows:    Again, as in the series of the cosine, we have an alternation of positive and negative terms, which is the only difference between this series and that for the hyperbolic sine. The series of fractions for the sine and cosine, like those for the hyperbolic functions, are thus simple, elegant, and memorable. Since the terms are alternatively added and subtracted, it is obvious why the functions are periodic and will not increase to infinity. In fact, they do not increase beyond 1 or decrease below -1.

We can now see why Euler's Theorem,  , takes the form that it does. The cosine series would supply the even terms for the imaginary powers of e, while the sine series supplies the odd terms. However, all the odd terms of eix are imaginary, so the sine series must all be multiplied by i itself. In short, eix is a complex number, with the cos x supplying the real part and sin x the imaginary part. Adding together the hyperbolic cosine and sine series for ex, on the other hand, is subject to no such complication, since all of those functions are real:  

Two other noteworthy equations are for the circular functions and for the hyperbolic functions. The solution for the equations of the circular functions may be seen at right. The terms for powers of e will be seen to cancel each other out. The integers that result in the numerator come from the circumstance that multiplying a number by its reciprocal (i.e. eix by e-ix) equals one.
The solution for the equations of the hyperbolic functions may also be seen at right. It should now be clear that the equation for the hyperbolic functions subtracts the hyperbolic sine term, while the equation for the circular functions does not subtract the sine term, because squaring the sine term with i in it produces a negative number, which supplies the effect of subtraction anyway. The elegance of expressions that at first seem so complicated but then simply reduce to unity is striking.

Another aspect of these equations can be explored when we note a couple of things. It turns out that the sine of a negative angle is equal to the negative of the sine of the positive angle:    This is also true for a hyperbolic sine:    However, the cosine and hyperbolic cosine of a negative angle are simply equal to the cosine and hyperbolic cosine of the positive angle:   and    This occurs because cosine values are symmetrical around zero, while sine values are positive on one side of zero and negative on the other. With these equalities, Euler's Theorem, and the corresponding hyperbolic equation, can be rewritten for reciprocals:    and  

Now, if we multiply eix by e-ix (or ex by e-x) we know the result will be 1, since we are simply multiplying a number by its reciprocal, which is always 1. However, we now can express eixe-ix as (cos x + i sin x)(cos x - i sin x) and exe-x as (cosh x + sinh x)(cosh x - sinh x)  These multiply out as (cos x2 - i2 sin2 x) and (cosh2 x - sinh2 x)  Notice that these are still identical in form. The square of i, however, in the circular function equation can be evaluated as -1, and this changes the sign in that equation:  (cos x2 + sin2 x)  Thus, we are back to our original equalities:   and  

While the result has seemed extraordinary to many people -- it was called "the most remarkable formula in math" by a young Richard Feynman -- there are even stranger effects with numbers to the i power. If we begin with Euler's Theorem,  , and use the angle /2 (i.e. 90o), the result, since the cosine of 90o is zero and the sine 1, is:   = i. This result can also be obtained directly, of course, just by taking the square root of each side of ! Then let's raise both sides of this equation to the i power:  ()i = i i. Since the power of a power is equal to the powers multiplied together, that equation is equivalent to:   = i i. We know, however, that i2 is -1, so we end up with:   = i i. Well, is a real number, which can be derived on any calculator:  i i = 0.207879576. By the same token, the imaginary root of i is also real. If we begin with = i, taking the i root gets us:   = ii. Since the i powers cancel out, we end up with:   = ii = 4.810477381, which is the reciprocal, as we should expect from the mere difference in sign on the exponent, of i i. Now, there are many expressions with imaginaries that are equivalent to real numbers, but it is especially remarkable that the imaginary power of the imaginary number, and the imaginary root of the imaginary number, are both themselves real numbers! If we wonder why ii = 1/ii, it helps to put the equation all in exponential form:  i1/i = i-i. In this way, it highlights the circumstance that 1/i = -i, or i-1 = -i, a curious property of i that is unrelated to Euler's Equation.

For even more about this, see Paul J. Nahin, An Imaginary Tale, The Story of -1 (Princeton University Press, 1998, pp.67-68 & 166-167).

Philosophy of Science, Mathematics

Home Page

Copyright (c) 1999, 2002, 2006, 2009 Kelley L. Ross, Ph.D. All Rights Reserved