Perfect Fifths in Equal Tempered Scales (Part 2)
Computational Complexity 2023-10-19
When I listed some equal-tempered scales with good perfect fifths in Part 1, a reader named Sylvain noticed something interesting. The scales with 5, 7, 12, 29, 41 and 53 tones are particularly good, and
29 = 12 + 12 + 5 41 = 12 + 12 + 12 + 5 53 = 12 + 12 + 12 + 12 + 5
I asked if this is a coincidence. And now I know the answer: no, it’s not! There really is a reason for this pattern.
As we’ll see, part of the reason is that
is very close to
But we’ll also see it’s crucial that 5 × 7 is slightly less than a multiple of 12. As far as I can tell, these coincidences are unrelated.
Surprisingly, the further coincidence that 5 + 7 = 12 seems to play no role. But maybe I’m just overlooking something!
All this started becoming clear to me when Scott Centoni wrote a little program in Sage to see how good the perfect fifth is in N-TET (the scale that divides the octave into N equally spaced notes).
When we use logarithms of frequency ratios, log(3/2) is a perfect fifth, while log(2)M/N is the Mth note in N-TET. So, one way to formulate the question mathematically is: how well can we approximate log(3/2) by log(2)M/N for some integer M?
Alternatively: how well we can approximate log(3/2)/log(2) by a number of the form M/N?
Scott Centoni graphed the answer to the latter question and got the following:
This graph shows the difference
for the best choice of M for each N from N = 5 up to N = 65. For example, take N = 12. Then M = 7 gives the best approximation to log(3/2)/log(2), and
So, the blue dot labeled 12 is very slightly below the x axis.
You’ll immediately notice a bunch of nice patterns in this chart. Most exciting to me are the descending bands consisting of either 5 even numbers or 5 odd numbers!
The bands of even numbers almost cross the x axis at multiples of 12, namely N = 12, 24, 36, 48, 60. The difference Δ is the same for all these N. Why? Well, 7/12 is so close to the magic number log(3/2)/log(2) that the best approximation to this magic number of the form M/24 is just 14/24 = 7/12. The best approximation of the form M/36 is just 21/36 = 7/12. And so on for quite a while… but not forever.
Also, if you look very carefully, you’ll see |Δ| is smaller for N = 58 than N = 60. So while multiples of 12 provide the best even choices of N for a while, this doesn’t last forever.
After a bit of glitchiness at the start, the bands of odd numbers come close to the x axis at numbers that are 5 more than a multiple of 12, namely 17, 29, 41, 53 and 65. Why? This is a bit more tricky. A good explanation of this was provided by gjm on Mathstodon, and I’ll quote it below. Ultimately the reason is that 7 times 5 is almost a multiple of 12… yet that hint will probably seem quite cryptic until you read what gjm wrote.
But first, another visibly obvious pattern: the scales with N = 5, 10, 15, 20, 25, 30 and 35 notes all have the same Δ. Why? Well, 3/5 is fairly close to the magic number log(3/2)/log(2), so the best approximation to this number of the form M/10 is 6/10 = 3/5. And so on for a while. But it turns out 21/35 = 3/5 is not as close to the magic number as 20/35, so the pattern breaks down at this point.
You can also see that the scales with N = 7, 14, 21, 28 and 25 all have the same Δ. The reason is similar: 4/7 is close to the magic number.
Now for gjm’s explanation of the bands of even and odd numbers, and further subtleties:
The pattern is a consequence of 7/12 being a good approximation for r = log(3/2)/log(2); there’s a little bit less here than meets the eye.
Write r = 7/12 + h where h is small (it’s a little bit smaller than 1/600).
Suppose we’re looking at a scale with N = 12n + k equally-spaced notes. Then the quality of the fifths depends on how close (12n + k)r is to an integer. Well,
(12n+k)r = 7n + (7/12)k + (12n+k)hCall these terms A, B, C.
A is always an integer so we can ignore it.
B mod 1 repeats with period 12. It’s zero when k=0, so multiple-of-12 scales are good as long as C stays small. It’s -1/12 when k=5, and C is positive, so N = 12k+5 scales are also pretty good, though (at least initially) not as good, as long as C stays small.
When does the pattern break? Well, C gradually increases as N = 12n+k does. After it crosses 1/24, at N = 26, B = -1/12 becomes better than B = 0; this doesn’t break the pattern yet but it means that “29 is better than 36” even though “12 is better than 17”. After C crosses 1/12, at N = 52, B = -2/12 becomes better than B = 0, and this does break the pattern for even N; N = 58 beats N = 60. After C crosses 3/24 at N = 76, even N starts beating odd N again. After C crosses 2/12 at N = 103, B = -3/12 becomes better than B = -1/12, which breaks the pattern for odd N; N = 111 is better than N = 113.
The prose is a bit dense here, but it very much repays close reading. In particular, why are equal-tempered scales with numbers of tones like
29 = 12 + 12 + 5 41 = 12 + 12 + 12 + 5 53 = 12 + 12 + 12 + 12 + 5 65 = 12 + 12 + 12 + 12 + 12 + 5
so good? It must be because these numbers times log(3/2)/log(2) are close to integers.
And why is that? Well, 7/12 is a tiny bit smaller than log(3/2)/log(2). So it must be because for n = 1,2,3,4 the number 12n + 5 times 7/12 is a tiny bit smaller than an integer. But that’s equivalent to saying 5×7/12 is a tiny bit smaller than an integer. And that’s equivalent to saying 5×7 is a tiny bit less than a multiple of 12. And that’s true:
While this post is about perfect fifths, I can’t resist showing you Scott’s similar chart for major thirds:
Now we are seeing how close some fraction of the form M/N comes to log(5/4)/log(2), since a major third has a frequency ratio of 5/4. While the patterns are striking, they are quite different than for perfect fifths! Presumably this is because there is no fraction with small denominator coming very close to log(5/4)/log(2).
Note that N = 53 gives a very good major third as well as a very good perfect fifth.
I also repeated Scott Centoni’s analysis for minor thirds:
Now we are seeing how close some fraction of the form M/N comes to log(6/5)/log(2), since a minor third has a frequency ratio of 6/5.
One could have a lot of fun further exploring these patterns, but at least we’ve seen why the number 12 becomes important as soon you get interested in equal-tempered scales with perfect fifths!


