If a note has frequency , then is the frequency of the note which we perceive to be the same but an octave higher. A further octave above that must be , and the integer multiple in between, , corresponds to the fifth above the first octave. The fifth above the original note is thus . If we continue to take multiples, we find is the major third above the second octave, so is the frequency of this interval within the first octave.

In general, intervals with small integer frequency ratios are the ones that sound “good” to the human ear. Many can be constructed from the octave, fifth and major third, since their ratios include the prime numbers 2, 3 and 5 respectively. A fourth is an octave minus a fifth: . A minor third is a fifth minus a major third: . A major seventh is a fifth plus a major third: .

Somewhat amazingly, 12 fifths is close to 7 octaves

and 3 major thirds is close to 1 octave

with 3 being a factor of 12. This is the reason that the scale is divided into twelve semitones. These notes are enumerated by the “circle of fifths,” which passes through each note once.

“Equal temperament” tuning chooses the logarithmic spacing of the notes to be be to ensure that no key sounds better than any other. This means that a fifth is approximated

In fact, since is irrational, there is no finite uniform division of the octave that will give an exact fifth. The next best approximations to after are , and . Note that a uniform division of the octave should also give a good approximation of the major third.

After 3 and 5, the next prime to consider is 7. In fact, the note is reasonably close to a conventional minor seventh, which can be obtained as a fifth plus a minor third (equal to two fifths minus a major third). This can be seen by comparing to . This may be partly the reason that a dominant seventh chord (root, major third, fifth, minor seventh) is slightly dissonant and known to resolve back to the major chord.

I gleamed most of this from Dave Benson’s online book “Music: A Mathematical Offering.”