
Starting on A0, we arrive after increasing by a series of 12 perfect fifths at A7. However, just because we call it an A7 doesn't mean that it really is a unique A7. If each fifth is a perfect fifth, each step corresponds to an increase in frequency by 3/2. So the final frequency of this A7 should be 27.5*(3/2)^12, or 3568.02 Hz.
The problem is that we get a different A7 if we move up the keyboard in perfect octaves from A0. We increase the frequency by a factor of 2 for each step, so the frequency of A7 achieved by 7 perfect octave steps from A0 is 3520.
There is a significant difference between the two A7's achieved by a series of perfect fifths and octaves: 48 Hz or 23.44 cents.
But the A7 on the keyboard can only have one frequency. One solution is to change what we mean by a fifth. The equal tempered scale is composed of 12 equally space intervals or semitones. Each corresponds to a change in frequency by the 12th root of two, so that after making 12 steps by this amount we double the frequency (an octave is 12 steps). The 12th root of 2 is 1.05946.
A fifth is now defined as an increase in frequency due to 7 semitone steps: e.g. A, A#, B, C, C#, D, D#, E
or 1.05946 multipled seven times: 105946^7 = 1.49831, not 1.50000. The interval has been shrunk a bit, and is no longer perfect. But walking up the scale with a series of 12 of these fifths will exactly equal 7 octaves, both increasing the frequency by 128 times!
This works very nicely, and the solution is what we call equal temperament. But the fifth is no longer perfect, and some claim that even though it almost sounds the same, it becomes tiring and irritating with time. The temperament doesn’t wear well.
So there have been many ways proposed to keep some intervals perfect at least over small stretches (i.e. repetitive intervals can never be perfect). For example, the fifth from A to E can be made perfect, as long as we adjust some of the semitones above E to bring us back to A and a perfect octave. Now the "distance" of the semitone depends on where we are on the keyboard. The result is that some keys will sound very nice, and some will not. This is the joy of well temperaments.
Show below is the tuning of the temperament octave (A3A4) on a Baldwin F in equal temperament. At the bottom the magnitude of the deviation of the overtones which should be coincident if the intervals were "perfect".