If you’ve ever had the hook from *Call Me Maybe* stuck in your head for three days, you know the power of a well-patterend musical hook. It’s these patterns in music that speak to our human brains and often help us differentiate good music from bad, and beautiful from ugly. Patterns, of course, suggest that math is at play, and this is no surprise. The connection between math and music has been well-studied from the geometric ideas of Pythagoras, the symmetries in music, and even music as topology.

What I want to talk about is how to use math to make the ugliest music possible. If patterns register as “beautiful” in our minds, then a completely pattern free tune would be the least beautiful. But to actually compose a totally pattern free piece of music is not an easy feat. Remember, pattern free is distinctly different from random (the latter being relatively easy). An interesting solution to this problem came to us by way of 1950’s work of engineers John P. Costas and Solomon W. Golomb. Costas and Golomb weren’t trying to write ugly music, rather, they were trying to solve a problem in sonar signaling. Turns out the same principles that make an ugly sound also make a great sonar ping. The solution was a combination of the Golomb Ruler, or its multi-dimensional cousin, the Costas array. These tools give a method for generating points that are not random (obviously), but are completely pattern free.

Using these tools, the mathematician Scott Rickard engineered the ugliest song every written. The basic idea is quite clever. Beginning with an 88 by 88 grid, starting in the far left column, he moves along the columns filling in boxes in rows corresponding to powers of 3. So in each column *n* he marks the *3 ^{n}*-th block. And when the numbers get too big, he reduces them modulo 88. This gives a totally pattern free sequence of points, and hey, also a handy representation of notes on the 88 key piano! He debuts this hideous (yet mathematically clever) opus in

*TEDx Talk: The Worlds Ugliest Music*. You probably won’t be humming the riffs all day, but it’s cool to hear.

The AMS has a great link-roudup of other blogs and videos about math and music, and since it’s still the month of June, find something beautiful to enjoy and have a happy Fête de la Musique!