## Mathematical Recreations

 MathRec Home Last Month's Problem Introductory Problem Older Problemsand Links Educational Resources Steve's Personal Page

#### Patterns in a2 + b2 = c2 (March 2002)

There are an infinite number of integral solutions to the Pythagorean formula a2 + b2 = c2. Here's a plot of the integral solutions for a < 300 and b < 200.

As you can see, there are clear patterns in the distribution. This month, I'm suggesting that you look for the patterns. Explore freely. To help you out, here's another plot. This time with some lines to guide your eyes.

Are there fundamental relationships underlying these lines? If so, what are they?

#### Solutions where a, b and c share common factors

Let's start with the red curves. These are perfectly linear, passing through the origin, with regular spacing between points. Each of these lines represents a set of multiples of some solution. The top line, where the points are most closely spaced is the 3,4,5 family. That is, the plotted points are at (4n, 3n) for integers n, and they represent solutions of the form

(3n)2 + (4n)2 = (5n)2.

The other two red lines represent the 8,15,17 and the 5,12,13 families.

#### Solutions with a common value of c – a

Now let's turn to the blue curves. These appear rather straight at the right side of the image, but they are clearly curved at the left side. They do not pass through the origin, and the spacing between points is not regular. These represent solutions with a common difference between a and c. For the lower curve, c = a + 2, and for the upper curve, c = a + 8. There is a curve for each positive integer k, such that c = a + k. You can use the red lines as a guide and see that the eighth member of the 3,4,5 and 5,12,13 families is on the upper blue curve, and the fourth member of the 8,15,17 family is on the upper blue curve.

The next thing to notice is that the curves for k = 3 through k = 7 don't start any families that aren't represented on the k = 2 curve. This is general. The initial members of new families only have certain values of k. Let's find out what they are.

Let's look for nontrivial solutions. That is, for solutions where a, b and c do not have any common factors. This means that they cannot all be even, or two would be a common factor. Of course, they cannot all be odd, since the sum of two odd numbers is even. Similarly, there cannot be two even numbers and an odd number. That leaves us with two possibillities: c is even and a and b are both odd, or c is odd and one of a or b is even.

Let's consider the case where c is even. Let a be greater than b, where a = s + t and b = s – t. Since a and b are both odd, s and t are integers. We find

2s2 + 2t2  =  c2  =  4u2,
where u is an integer, since c is even. Now note that exactly one of s or t is odd, since their sum is odd. Therefore, s2 + t2 is odd. According to the equation above, however, it must be even. Therefore, there are no solutions where c is even and a and b are odd.

We now know that c is odd for all nontrivial solutions. Let a be odd and b even. We can choose s and t, such that c = s + t and a = s – t. We find

b2  =  c2a2  =  (s + t)2 – (st)2  =  4st.

We are looking for nontrivial solutions, so s and t have no common factors. Since st must be a perfect square, s and t must each be perfect squares. As a final restriction, note that s and t cannot both be odd, because a, b and c would all be even.

Therefore, all solutions to the equation a2 + b2 = c2 have the form

 a  = n (i2 – j2) b  = n (2 i j) c  = n (i2 + j2)

where n is an integer, and i and j are relatively prime positive integers. We have to include i = 1, j = 0 as a special case. If we ignore solutions where i and j are both odd, then every solution corresponds to unique values for i, j and n.

Let's get back to the groups where c – a or c – b are constant. We see that for nontrivial solutions, c – a = (i – j)2 and c – b = 2 j2. Therefore the blue curves in the diagram correspond to k = 2 = 2j2 and k = 8 = 2j2. The curve (not highlighted in blue) corresponding to k = 1 = (i – j)2 contains nontrivial solutions, but for each of these solutions, there is a member of the family in the k = 2 curve. The curve (not highlighted in blue) corresponding to k = 9 also contains nontrivial solutions, and the next such curves would be for k = 18 and k = 25. (Note that i – j is always odd, so the curves which contain nontrivial solutions have k equal to the square of an odd integer or to twice the square of any integer.)

#### The green curve

The green curve in the diagram above seems to follow a path starting in the upper left where b is much greater than a and finishes in the lower right where a is much greater than b. To the best of my knowledge, there is no fundamental relationship between the points on this "curve." (I plotted the path as a series of line segments.)

I can suggest at least one good reason why I think it's very unlikely that there is any fundamental relationship. First of all, there must be a final point in the sequence on the top and on the right, unless the sign of the slope changes. The final plotted point in the sequence is on the blue curve corresponding to k = 8, and there are no points below the k = 1 curve, so this sequence can't approach the a-axis.

I think the eye is drawn to this pattern because of the symmetry about the line a = b. The solutions 96,110 and 100,105 are duplicated by the intrinsic symmetry, so that 105,100 and 110,96 are immediately added to the sequence to form a line of four points. Neither of these is the first member of their family, and a fortuitous alignment of two families near the axis is not surprising. (There are a few other families that didn't line up, but our eye sees the coincidence, not the missed coincidences.) Once you get away from the center of the graph, it's easy to find points in a gradually decreasing slope to continue the sequence.

There are other coincidences, too, but this one traces very nicely to the edge of the graph.

Send all responses to .

Thanks,
Steve