June 27, 2020

Prime Listening

The human ear has remarkable capabilities—so remarkable that we generally accept as routine such formidable tasks as recognizing a voice, picking out a single word in a cacophony of cocktail-party chatter, or hearing a flute's sweet tone in the midst of an orchestral romp.

Our sense of hearing can integrate disparate sounds into a harmonious whole or detect subtle nuances buried in noise. It has amazing powers of pattern recognition. Indeed, by using sound to represent masses of data or jumbles of numbers, we can take advantage of that capability to identify regularities or make subtle distinctions.

Mathematician Chris K. Caldwell has developed a scheme for listening to sequences of primes—to hear both simple patterns and perplexing irregularities found among those numbers.

"Multimedia allows the use of sight and sound, so why not use sound?" Caldwell asks. "After all, don't we use our ears to detect patterns as we listen to the car motor for a problem or shake a box to determine its contents?"

The MIDI (Musical Instrument Digital Interface) specification often used in computer programs to represent musical notes assigns a number to each note on a keyboard. According to this recipe, middle C is 60, C-sharp is 61, D is 62, and so on, for a total of 128 notes. One could use that correspondence directly to "play" primes. For example, 67 would then be G.

There are infinitely many primes, however, so Caldwell's strategy is to divide each prime by a fixed number, then play just the remainder—a novel application of that standard number-theory tool known as modular arithmetic.

For example, if the divisor, or modulus, is 7, then for the primes {2, 3, 5, 7, 11, 13, 17, 19, 23. . .}, one would play {2, 3, 5, 0, 4, 6, 3, 5, 2,…}. Because those particular notes on the MIDI scale would be too low in frequency to be audible, Caldwell adds a constant, such as 55. Hence, the first prime, 2, is played as the note A. There are seven possible notes.

Primes modulo seven

In listening to the primes modulo 7, you find that all seven notes are played, but the lowest note occurs just once. That lowest note is the prime number 7. Any other number that leaves a remainder of 0 when divided by 7 must be a multiple of 7, so it can't be a prime. A theorem of Peter Gustav Lejeune Dirichlet (1805-1859) on primes in arithmetic progression guarantees that all the other notes are heard infinitely often when one plays all the primes.

Trying various prime and composite divisors reveals other patterns, and one can check which notes are played infinitely often, which ones are played just once, and which ones are never played for each modulus.

It's possible to use the duration of notes to represent the gaps between prime numbers. There's no gap between the first two primes, 2 and 3. There's a gap of one between 3 and 5, a gap of one between 5 and 7, and a gap of three between 7 and 11. According to the prime number theorem, the average gap length up to a certain prime equals the value of the natural logarithm of that prime.

Caldwell makes the note representing a particular prime last a time proportional to the size of the gap to the next prime in the sequence, divided by the natural logarithm of that prime.

Caldwell's "Prime Number Listening Guide" offers his weirdly tuneful "primes modulo 41 with prime gap tempo" and other primal sounds and even a way to make your own prime music.

There may be more to come. Caldwell has started to develop a program to play the factorizations of sequences of numbers. "The low primes are used to determine what percussion instrument to play, the next larger primes are mapped to one instrument, and the larger ones (modulo some base) are mapped to a second," he says. "If the integer is divisible by a power (greater than 1) of the prime, then that prime's 'note' is played louder."

You may one day hear more of the concert theorems that mathematicians have so painstakingly gleaned from their studies of integers and the primes.

Originally posted June 22, 1998

No comments: