Say you want to find all the N-tone equal tempered scales that have better fifths than any scale with fewer notes. Mathematically this means you want to find all fractions that come closer to log₂(3/2) than any fraction with a smaller denominator.
You get *some* of these by taking the continued fraction expansion of log₂(3/2), shown below, and truncating it at some point.
This method gives you the list of fractions
1/𝟭 = 1
1/(𝟭+ 1/𝟭)) = 1/2
1/(𝟭 + 1/(𝟭 + 1/𝟮)) = 3/5
1/(𝟭 + 1/(𝟭 + 1/(𝟮 + 1/𝟮)) = 7/12
and so on. But this method does not give *all* the fractions that come closer to log₂(3/2) than any fraction with a smaller denominator. For example, 2/3 and 4/7 are two you don't get by this method!
These others show up whenever a number in bold is bigger than 1. The second time this happens is for
1/(𝟭 + 1/(𝟭 + 1/(𝟮 + 1/𝟮)) = 7/12
What we do then is look at the previous fraction (3/5) and the one before that (1/2), and write down this funny thing built from those two:
(3n + 1)/(5n + 2)
When n = 0 this is 1/2 (already on our list), when n = 1 this is 4/7 (new), and when n = 2 this is 7/12 (already on our list).
The number 4/7 is not on our list, so it's a new candidate for being closer to log₂(3/2) than any fraction with a smaller denominator. And it is!
You may get more than one new number using this procedure. Alas, they aren't always closer to log₂(3/2) than any fraction with a smaller denominator. But this procedure does give every fraction with that property.
Even better, this algorithm is a general procedure for finding the best rational approximations to irrational numbers! - where by "best" I mean: closer than any fraction with a smaller denominator.
(1/n)