It's the archetypal source of mathematical puzzles, not to mention a wellspring of appalling, grimace-inducing, geek humor and puns. You ever heard the one about the Native American lady who had a chip on her shoulder, and had a hippo skin especially imported to demonstrate her superiority? Two other women in the tribe, sitting on their buffalo and coyote skins, had enough of her posturing, and sent their boys over there to sort her out. The boys found that the fight was an even match. The squaw on the hippopotamus is equal to the sons of the squaws on the other two hides. Groan.It's almost as quotable as E=mc². One of those equations which can be quoted, again and again, without ever needing to understand its meaning. a²+b²=c², an equation perhaps made even more remarkable, because no exponent higher than 2 admits anything other than trivial solutions in integers. It's captivating as well, because it relates lengths with squares, with areas, it lives in that peculiar netherworld between geometry and trigonometry, and it's equally happy in the world of number theory as it is when talking about triangles. Generating all integer solutions is an entertaining problem; and it's very appropriate to mention the smallest solution to the problem when first introducing the theorem. 3²+4²=5². The 3-4-5 triangle has attained some mystical properties over the ages, sides 3, 4, 5… area 6. It is quite remarkable that the sides are consecutive integers; that the area is also consecutive is quite remarkable, but it is unlikely we will find other examples of all of those things happening at once, ever again – just some bizarre small-number coincidences going on. It is worth asking, though, whether there are any other Pythagorean triangles (right-angled triangles with integer sides) that have some similar properties to the 3-4-5. The simple problems Let's look at it a pair of sides at a time, for example, let's take the 4 and 5 sides first. Are there any other Pythagorean triangles whose two largest sides are consecutive? This turns out to be easy to solve, we simply put c=b+1 in the equation and, with a little bit of rearrangement, get a²=2b+1. That gives a method for generating solutions; we simply pick any odd number for a, and then calculate b and c=b+1. 3-4-5 is the first; we can continue with 5-12-13, 7-24-25, 9-40-41… and so on, ad infinitum. Intriguingly, this progression of triangles gets narrower and narrower. The hundredth such triangle, 201-20200-20201, has its smallest angle only a little over half a degree. What if we take the 3 and 5 sides; are there any other Pythagorean triangles with a side that's 2 shorter than the longest? Evidently there are; we simply take the solutions to the previous puzzle and scale those triangles up by a factor of 2, giving, for instance, 6-8-10, 10-24-26, 18-80-82… but is that all of them? Again, we can solve by writing c=b+2 and with a bit of rearrangement get a²=4b+4. This time, then, we pick any even number for a, and the answers fall out: 4-3-5, 6-8-10, 8-15-17, 10-24-26, 12-35-37. We did indeed miss half the solutions by doubling the solutions to the previous problem. The more difficult problem At this point, you have probably noticed that I'm ducking the question. There's something a bit unsatisfactory about looking for solutions with one leg and the hypotenuse consecutive; or one leg and the hypotenuse two apart and hoping the other side fills the gap. Wouldn't it be more appealing if there were solutions for Pythagorean triangles with consecutive legs? Solving the other two problems did not really appear all that difficult; surely this third problem cannot be much harder; if we go ahead and substitute b=a+1, surely the answer will come right out just like the others did? Unfortunately, something very different happens this time. With the other problems, the equation simplified greatly as a difference of two squares, but this time, no such luck. We might try plugging in values for a, and, if we're patient enough, we might find the next solution is 20, 21, 29. With a little bit of work and rearrangement, we do however get somewhere: (2a+1)² + 1 = 2c². Writing x=2a+1 and y=c, we get x² + 1 = 2y², which is an example of something known as a Pell equation. At this point, you may simply wish to go look up the method how to solve this equation; but wait, that looks like rather a large book! If we rearrange our equation we'll see that x/y is approximately equal to the square root of 2. If we can find some good rational approximations to √2, in fact, the best approximations we can, perhaps we can solve the problem ourselves. The technique used for best rational approximations to irrational numbers is called the method of continued fractions. Again, this could be enough to point you towards a book, but suffice it to say for our purposes, continued fractions work by approximating a number by an integer part and a fractional part. The fractional part is then represented as a reciprocal of a number greater than 1, which, likewise, can be written as an integer part and a fractional part. The trick is, the error at each point is reduced, because the error term is dwarfed by the integer part, and the repeated reciprocal-taking makes the error term relatively smaller at each turn. Go ahead and try this on a calculator. Get √2 on the screen, 1.414…. and the integer part is 1. Subtract that 1, giving 0.414…. and now press the reciprocal (1/x) button, and, quite remarkably, you'll get 2.414…. What's going on here? Well, you've just discovered an interesting mathematical identity: √2 = 1 + 1 / ( 1 + √2). OK, strictly speaking, you haven't actually proved it – to do that, you might want to multiply out (√2 – 1)(√2 + 1). That's all well and good, but how does that help? Well, suppose you have an estimate e, that is approximately equal to √2. By the mathematical identity above, you'll find that e' = 1 + 1 / ( 1 + e ) might be a better estimate. And by repeating the process, the estimates would get better and better, approaching ever closer to the √2 that this process converges to. Give it a try. Start with an estimate e = 1, and plug it in. The next better guess is e = 3/2, after that e = 7/5, then 17/12, then 41/29… Actually, these don't seem to be going too badly, they're already getting quite close to that √2. The observant might even spot there's a quick way to continue this sequence 1/1, 3/2, 7/5, 17/12, 41/29… (or look them up in the Online Encyclopedia of Integer Sequences – numerators are A001333 and denominators are A000129). The quick method for both numerator and denominator is to double the current term, then add the previous one; so after 1, 3, 7, 17, 41, the next term is 2*41 + 17 = 99, and after 1, 2, 5, 12, 29, the next term is 2*29 + 12 = 70. 99/70 is a pretty good approximation to √2 already; three decimal places and the fourth well on its way. There are numerous other patterns to spot in there as well, and many, many ways to generate the sequences. Armed with these approximations, can we plug them in to our equation with x=2a+1 and y=c? Indeed we can; the approximation 7/5 gives us the 3-4-5 triangle, and the approximation 41/29 gives the 20-21-29 triangle. Wait! What happened to that 17/12? Well, it turns out that doesn't fit the equation x² + 1 = 2y²; the sign of the 1 isn't quite right. But it does look like alternate terms in the approximations will work. So the solutions to this thorny Pythagorean problem? 3-4-5, 20-21-29, 119-120-169, 696-697-985 … These appear to grow far quicker than the answers to the previous problem. Remember when we considered the hundredth solution before? This time, even the tenth solution is 27304196-27304197-35613965, pretty much as nearly isosceles as we can get, differing from 45 degrees by maybe a millionth of a degree. There are of course an infinity of solutions, but they will get very large, very quickly. Want more?
Dr Ron Knott has a thoroughly intriguing page of Pythagorean facts, well worth checking out! There are plenty of Pythagorean puzzles, just waiting to be cooked up.