Many people have commented over the ages on the similarities between mathematics and music. Leibniz once said that "music is the pleasure the human mind experiences from counting without being aware that it is counting". But the similarity is more than mere numerical. The aesthetics of a musical composition have much in common with the best pieces of mathematics, where themes are established, then mutate and interweave until we find ourselves transformed at the end of the piece to a new place. Just as we listen to a piece of music over and over, finding resonances we missed on first listening, mathematicians often get the same pleasure in rereading proofs, noticing the subtle nuances that make the piece hang together so effortlessly.

It is one of the failings of our mathematical education that few even realise that there is such wonderful mathematical music out there for them to experience beyond schoolroom arithmetic. In school we spend our time learning the scales and time signatures of this music, without knowing what joys await us if we can master these technical exercises. Very few would have the patience to learn the piano if they were denied the pleasure of hearing Rachmaninov.

Riemann's Symphony

One of the great symphonic works of mathematics is the Riemann Hypothesis - humankind's attempt to understand the mysteries of the primes. Each generation has brought its own cultural influences to bear on its understanding of the primes. The themes twist and modulate as we try to master these wild numbers. But this is an unfinished symphony. We still await the mathematician who can add the final chords to this grand opus.

But it isn't just aesthetic similarities that are shared by mathematics and music. Riemann discovered that the physics of music was the key to unlocking the secrets of the primes. He discovered a mysterious harmonic structure that would explain how Gauss's prime number dice actually landed when Nature chose the primes.

Gauss's function compared to the true number of primes

Riemann was very shy as a schoolchild and preferred to hide in his headmaster's library reading maths books rather than playing outside with his classmates. It was while reading one of these books that Riemann first learnt about Gauss's guess for the number of primes one should encounter as one counts higher and higher. Based on the idea of the prime number dice, Gauss had produced a function, called the logarithmic integral, which seemed to give a very good estimate for the number of primes. The graph to the left shows Gauss's function compared to the true number of primes amongst the first 100 numbers.

Gauss's guess was based on throwing a dice with one side marked "prime" and the others all blank. The number of sides on the dice increases as we test larger numbers and Gauss discovered that the logarithm function could tell him the number of sides needed. For example, to test primes around 1,000 requires a six-sided dice. To make his guess at the number of primes, Gauss assumed that a six-sided dice would land exactly one in six times on the prime side. But of course it is very unlikely that a dice thrown 6,000 times will land exactly 1,000 times on the prime side. A fair dice is allowed to over- or under-estimate this score. But was there any way to understand how to get from Gauss's theoretical guess to the way the prime number dice had really landed? Aged 33, Riemann, now working in Göttingen, discovered that music could explain how to change Gauss's graph into the staircase graph that really counted the primes.

Shapes and sounds

The key to understanding Riemann's ideas is to explore why a tuning fork, a violin and a clarinet sound very different, even when they are all playing an A, say. The graph of the sound wave of the tuning fork looks like a perfect sine wave. In contrast, the sound of the violin playing the same note looks like the teeth on a saw, a much more jagged sound. You can follow this link to see and listen to the contrasting wave shapes of a tuning fork, violin and a clarinet as they play an A.

The reason the violin doesn't look and sound like the tuning fork is that it is playing, not just an A, but also a combination of different frequencies called the harmonics. We get an additional note for each sine wave that fits exactly along the length of the string. Each additional note beats faster, which means it sounds higher. As the notes get higher they get gradually quieter, which is equivalent to the height of the sine wave getting smaller.

By adding the heights of these additional harmonics onto the graph of the tuning fork, we see how we can change the sine wave into the saw-tooth shape of the wave shape cerated by a violin.

To be continued...