This script helps gearbox design by finding the optimal gears for a gearbox that fits inside a particular range of ratios. In other words: If you need a D220-D231 gearbox, enter 220 an 231 as the range below, and it will tell you what gears you need to get a final ratio of 220% to 231%.
The output format is specified as an equation: Each division indicates gears with that many teeth 'meshed', and each multiplication indicates a gear on top of another. It's simpler than it sounds, here's an example for a gearbox that has a ratio of 42%:

Formula Cost
(3/6) * (5/6) = 42%
4 medium gears

This indicates that you should have a 3 tooth gear driving a 6 tooth gear, which is stacked with a 5 tooth gear driving a 6 tooth gear. Invisible in here, due to the shorthand is another 5 tooth gear, as a 3 and a 6 cannot be directly connected. Here's the shorthand ratios used:

Shorthand Expansion
(3/6)(3/5) * (5/6)
(6/3)(6/5) * (5/3)
(4/5)(4/7) * (7/5)
(5/4)(5/7) * (7/4)

The cost column gives the cost in medium gears. Small gears are costed at nothing, and large gears are equivalent to 6 medium gears.

A few points: For the existence of this tool, I owe my everlasting gratitude to Isomer, for hacking up in python the tool I originally used to search for the best gearboxes, Tamutnefret for upstaging me by having already created a list (that list now drives this script), Zubon, for his post containing price estimates for the gears, possible gear arrangements, and other information, to FaceAnkh, for making the sed one-liner to convert the original data into a format more usable for the database, Brant|SN and TheDude[OWRH] for their brief participation in the Distributed Optimal Gearbox Effort, and to Garan for his assorted contributions in IRC.

I've now put up the source and a dump of the DB for anyone that wants to mirror this or create their own.

Find me a gearbox between % and %
Expand shorthand ratios
Use (a/b/c) notation instead of shorthand