On the Teeth of Wheels
Reading on in Merritt's book, I soon learned why aspects of number theory have attracted the interest of gear makers. Here is an example of the basic problem. Suppose you have a shaft that turns once per minute, and you want to design gears that will slow this motion to one revolution per day, which works out to a speed ratio of 1,440 to 1. The first law of gearwork says that the speed of a gear is inversely proportional to the number of its teeth. Thus the most direct solution would be a driving gear (a pinion) with just one tooth, meshing with a driven gear (or wheel) of 1,440 teeth. But a one-tooth gear would be extremely awkward, and a 1,440-tooth gear is inconveniently large. You could solve the problem of the too-small pinion by multiplying both sides of the ratio by some convenient number, say 10. You would then have a pinion of 10 teeth, but of course the already-too-large wheel would be even larger, with 14,400 teeth.
The answer to this quandary is a compound gear train, where two or more pairs of mating gears progressively reduce the rotational speed. In a two-stage train, a pinion a meshes with a wheel A; then a second pinion b, mounted on the same shaft as A, turns wheel B. The overall gear ratio is a/A x b/B, and so you can choose any convenient values of a, A, b and B that yield the correct product. For example, compound gears with the ratios 6/200 and 5/216 form the product 30/43200, which reduces to the required 1/1440. If wheels of 200 and 216 teeth are still too large, then a three-stage train with ratios of 6/72, 6/60 and 5/60 would yield the same result. (I ignore the fact that each pair of gears reverses the sense of rotation.)
The next question is: Where do numbers like 6/200 and 5/216 come from? It's easy to verify that they produce the correct ratio, but how do you find such numbers in the first place? The answer comes straight from number theory: factoring. In the ratio 30/43200, the numerator has the prime factors 2x3x5, and the denominator breaks down into eleven factors: 2x2x2x2x2x2x3x3x3x5x5. The Fundamental Theorem of Arithmetic guarantees that no matter how you group these factors, their product will always be the same. The factors of the numerator can be partitioned into two groups in just three ways: 6x5, 3x10 and 2x15. The factors of the denominator 43,200 can be partitioned into two groups in 41 distinguishable ways.
This application of factoring explains the presence in Merritt's book of a "table of factors of useful numbers up to 200,000." The "useful" numbers turn out to be those whose largest factor is no greater than 127, which Merritt suggests is a reasonable upper limit for the number of teeth on a gear. Number theorists have another word for the same concept: Integers that have many small factors are called "smooth" numbers.
Does the need to factor numbers make the design of compound gear trains a hard computational problem? Factoring has an enigmatic status in computer science: For conventional computer hardware, the only known factoring algorithms are inefficient, and therefore slow in the worst case, but no one has proved that better algorithms cannot exist. For gear design, however, the issue of algorithmic intractability simply does not arise, because the factoring of smooth numbers is always easy. Even the crudest algorithm—trial division—works quickly with numbers that have only small factors.