# Is there a relationship between prime numbers and music?

Is there a relationship between prime numbers and the series of overtones and their frequencies?

I've found links to Euler's research about math and about music, and I got goose bumps when I found that here is a whole universe of correlation.

Can someone breakdown this theory for dummies like me?

http://www.tonalsoft.com/monzo/euler/euler-en.aspx

I mean especially the correlation of string-length, overtones, and prime numbers. After thinking about it and trying to explain it to me, I've found that this is very simple, but I never realized this relationship.

• That's a bit of a broad question. Without exposing my relationship to the people behind it, I can only say that one of my relatives is a mathematician behind research that aims to bring together Number Theory and music. There are a number of prime-number applications concerning music, some involving the Sieve of Eratosthenes, and one of my own involving a non-reversible function based on prime number properties to produce automated music. You will have to be a tad bit more specific. Sep 23 '19 at 12:31
• probably I'll have to study first this: arxiv.org/ftp/arxiv/papers/0801/0801.4049.pdf and this here: open.edu/openlearn/whats-on/tv/… Sep 23 '19 at 13:17
• No. there's only false correlations such as the one demonstrated in PeterJ's answer. Sep 23 '19 at 13:48
• If I remember correctly, the Bohlen-Pierce scale is built on primes, specifically 3:5:7. youtube.com/watch?v=Ur6GOoSNGN0 en.wikipedia.org/wiki/Bohlen%E2%80%93Pierce_scale Sep 23 '19 at 14:10
• I have the book Music and Mathematics: From Pythagoras to Fractals. It's a decent read, the math should be graspable for anyone at high school level or above. Sep 23 '19 at 23:22

There is one observation with respect to primes. No prime power (except 0) is a power of any other prime. Thus no number of stacked fifths will be equal to any number of stacked octaves. (Taking a fifth to be a ratio of 3:2). Thus, any useful music over more than a few notes will need tempering.

"Pythagorean" tuning uses only ratios using 2 or 3. "Just" tuning uses ratios using 2, 3, and 5. The Pythagorean third becomes 81/64 and the Just third is 5/3; these don't match.

Other than this, there isn't much except for figuring out how to temper the difference between (for example) 7 octaves and 12 fifths in a practical manner.

• This. With the exception of 2, there is little use of primes in music. (Exceptions are: 5 half-tones to a fourth, 7 to a fifth, sometimes a 3 in rhythm, and 7 notes on the diatonic scale (which feels more like an accident). But that's about it. The factor 2, on the other hand, is pervasive in rhythm and is the basis for calling two frequencies the same note on the scale. Also, `12 = 2*2*3` semitones form the basis to all harmonic theory.) Sep 23 '19 at 23:15
• Yes. The factor of two octave equivalence sort of crowds out the other primes. The (supposedly acoustically determined) interval of a fifth at 3:2 can never match up.
– ttw
Sep 24 '19 at 0:37
• I really missed this Pythagorean comma. Shame on me! Sep 24 '19 at 15:04

I would say "trivially, yes".

Yes, because music can be analyzed and is often created in ways that involve numbers and fundamentals of algebra (such as addition and multiplication), and once numbers become involved, and particularly when multiplication (and division) is involved, prime numbers become significant.

Trivially, because every branch of human thought that can be analyzed and/or developed using numbers and basic algebra, and particularly multiplication/division, has a meaningful interaction with prime numbers.

That is because the very nature of prime numbers is they create patterns in how numbers in general are multiplied and divided.

Here is a list of only some of the areas of music where prime numbers have important interaction with the concept because of the usefulness of multiplication and/or division of whole numbers:

• frequency ratios and intervals
• time signatures and rhythms
• tuning, intonation, and scales
• resonance, damping, and instrument construction
• acoustics
• etc.

There are overlaps between some of those areas, as many will surely notice.

Specifically regarding Euler's ideas, they don't seem particularly helpful to me, at least from a musical point of view. They might be interesting in their own way, but I think there's a reason that people don't frequently refer to these ideas when talking about music. Also, Euler's mathematical innovations are much more exciting.

• @ Todd: I've corrected and edited my question. It was really primarily concerning the acoustic fundamentals as note length respectively the frequency and the prime numbers. I've learnt both at school but I didn't check that it is not just a correlation, in fact it is the same! That's the effect when teachers are teaching some stuff in math, physics and music, but they don't see or don't know the connection. It has not been connected in my head, honestly! You can still explain this point of frequency and primes or show that this question/answer has already been posted and this is duplicate :) Sep 23 '19 at 15:34
• @AlbrechtHügli I'm not sure why you mentioned your edit since I answered the question well after you made the edit, and my answer has the edit in mind. My answer is still "Yes, trivially". Maybe I can expand it more plainly and say "Yes, but not in any way that is especially meaningful to us as musicians or composers or lovers of music." Sep 23 '19 at 15:36
• Sometimes the most trivially things are not trivial. I knew that math and music were elements of the trivium/quadrivium. But the relationship of the two things has not been trivial to me until today. My question is still useful and appropriate as this stuff (acoustic) is elementary knowledge for every music student. If you know the primes from the 3rd class you can derive the frequencies of all harmonics - that's what I didn't realize. I just know them from the overtones of the brass instruments and by learning them by heart. What is trivial for one seems not to be trivial for everybody. Sep 23 '19 at 15:45
• Trivially, because every branch of human thought that can be analyzed and/or developed using numbers and basic algebra, and particularly multiplication/division, has a meaningful interaction with prime numbers. maybe I really haven't got the meaning of prime numbers that you say it is trivial. I'll have to think more about this phenomena in my everyday life. Anyway you brought some points I still was not thinking of. Could you explain to me the relationship of other aspects or units. I've now started to understand the relationship of primes and frequency. Sep 24 '19 at 11:49

YES! And it's a fascinating one.

The primes (>3) only ever occur at 6n+/-1 (next to a number divisible by six). This is because of the interaction between the products of the numbers 2 and 3. If you think of the number line as music in 6/8 time then the primes always occur on the second or last quaver of each bar. Thus 5, 7, 11, 13, 17, 19 etc.

The distribution of primes in entirely determined by the interaction between the 'product-waves' of smaller primes. Each prime produces products at 6n+/-1 according to a rule such that there are two products at this location in every 6p numbers. For instance, the products of 5 occurring at this location do so always at 6np+/-p, thus twice in every 30 (6p) numbers.

This is all to do with interacting frequencies and number theory makes extensive use of Fourier analysis. The trick to the analysis is to recogise that there is no 'music of the primes' but is, rather, a 'music of the products of primes', and this is what determines the distribution of primes.

Anyone with a grasp of acoustics and the mechanics of vibrating strings will easily be able to grasp how the primes work.

• Are you counting the first quaver as zero? That is rather counterintuitive. Sep 23 '19 at 13:34
• This is cherry-picking of the finest quality. One can work to find some apparent relationship between primes and resonances in music, but there is nothing in the mathematics of primes (like when pairs occur) that have anything to do with either Western or Eastern development of music theory. Sep 23 '19 at 13:49
• @phoog, not if you're a programmer (unless you program in Visual Basic, where array indices start at 1). Sep 23 '19 at 14:00
• The first point is pretty meh, choosing to represent the number line as a series of 6-beat measures is rather arbitrary and doesn't add anything to the fact that primes >3 can be represented as 6n+/-1. I don't understand the rest of the answer at all - there's apparently something about note frequencies, Fourier analysis, and mechanical vibration, but I have no idea how that relates to prime numbers. Sep 23 '19 at 14:14
• Does anything you have said apply specifically to primes and not to numbers of the form 6n+-1? Sep 24 '19 at 13:56

The era of equal temperament ushered in by Bach has rendered ratios such as 3:2 obsolete. Music of the past couple centuries that uses a 12-note scale changes the frequency of each ascending note by multiplying the current note's frequency by 2^(1/12) which we call the twelfth root of 2. It makes sense because that is a geometric progression.

It blows the minds of those who think an interval of a major fifth (say C to G) has to be 1.5 times the frequency exactly. Mr. Bach changed that to be a compromise value of 2^(7/12) exactly. Here's the ratio of the interval of a fifth (C to G for example) in 12 place precision: 1.49830707688:1.

Each half step requires multiplying the frequency by 2^(1/12) or 1.05946309436 which is an irrational number (which means it is not and cannot be the ratio of any two integers.) If you multiply that number by itself 12 times, it means you have moved up the 12 semitones (half-steps) that make up our 12-tone scale, and you get the integer 2. Every octave is the second harmonic, or double the frequency of the starting note. This means that a particular note in any octave will be "in-tune" with that note in any other octave. hence all As are in tune with each other, all D#s are in tune, etc.

That is not true for fifths, which will have a "beat" or wavering sound when played against the root note. This may be the origin of the exaggerated vibrato many singers inflict upon our ears these days.

Sorry if I busted any bubbles, but ever since Bach, instruments which use the 12-tone scale are designed and manufactured to be tuned to, and musicians spend their lives learning to play in, equal-temperament, using the twelfth root of two, which is an irrational number meaning it cannot and does not equate to a ratio of any two integers, prime or not.

Other scales with different numbers of notes may have some intervals that equate to the ratio of two integers and it may even be possible to base the intervals on a ratio of two primes, but such tuning would be almost completely incompatible with the common 12-tone system. (Unless of course your composition was "Sonata for Cat and Lawnmower")

Sorry.

Now, enough math for one day! I'm going to go back to my composing.

• "ushered in by Bach": equal temperament did not come into regular use until the middle of the 19th century. And tempered fifths, even farther from the 3:2 ratio then equal-tempered fifths, were in use for a couple of centuries before Bach. Equal-tempered fifths generally beat too slowly to affect the musical texture much. The same cannot be said for equal-tempered major thirds. Sep 24 '19 at 13:39
• Furthermore, people making music without keyboards continue to use justly tuned intervals, and people continue to tune (or rather in recent decades have resumed tuning) keyboards in unequal temperaments. You also have new "microtonal" music being written in recent decades that explicitly specifies just or more-nearly-just tuning. Sep 24 '19 at 13:52
• W3BC, your statement has many truths. Of course the equal tempered tones are not related with the prime numbers, but TET was not my concern. I was wondering whether there is a metaphysical secret behind the natural overtones and the prime numbers. Sep 24 '19 at 22:03

This is my answer (but it is not just a kind of Q-A (as I really didn't see this relationship before!)

Starting with the smallest primes:

They are 1,2,3,5,7,11 ...

That's what we have learnt in the primary school: these numbers can only be divided by 1 and by themselves.

the overtones, (harmonics) and the frequencies: note that I've edited wavelength to length of string!

in the 1. column of the chart is Length of string in the 2. the Frequency factor in the 3. the resulting tone

1 => 1 = e.g. C

1/2 => 2 = c

1/3 => 3 = g

1/4 => 4 = c (8va of c 1/2 x 1/2)

1/5 => 5 = e

1/6 => 6 = g (8va of g 1/2 x 1/3)

1/7 => 7 = b7

1/8 => 8 c (8va of c 1/2 x 1/4)

1/9 => 9 d (5th of g 1/3 x 1/3)

1/10 => 10 e (8va of e 1/2 x 1/5)

etc.

as we can see the bold frequencies are the new overtones all others are multiples of already derived overtones which can obviously be divided by an other prime that has already been derived. This tabula shows that each new harmonic tone must obviously be identical with the next prime number that can't be divided in another number than one or itself. That's why some may say this is trivial but it has not been trivial to me until now! There is not a similarity or correlation between the harmonics and the primes. They are identical.

Edit:

With this last sentence I meant to say:

Prime numbers and overtones are one and the same thing - only in different terms and medias, as all not-primes numbers must be octavas or fifths of overtones of those we have already developed: e.g.

But I see now what I have missed: the pythagorean comma: 7 octavas are not equal 12 fifths. I had completely forgotten this point!

Here I have found an aritcle saying the same:

The harmonic numbers are equivalent to the values of the source harmonics in all previous discussions of harmonic evolution. Since we only studied those up to Quintality, most were prime. But as we can see from the chart, numerically, most source harmonics and harmonic multipliers are non-prime, any of which is a product of primes – its own series of harmonics and multipliers. We will call the first in the series its root harmonic, which is thus distinct from the product itself – the source harmonic. It determines the root spiritual or physical nature of the product’s lineage.

It says equivalent what I think this is better than one and the same.

and here's another link that says they primes and harmonics are eyuivalent:

http://tonalsoft.com/enc/p/prime.aspx

http://tonalsoft.com/enc/p/prime.aspx

• That's a tautology: you're just saying that harmonics are either prime or a multiple of other harmonics. It's the same for numbers: each number is either a multiple of another number or it's prime. Sep 23 '19 at 17:28
• Note though that 1 is not normally considered as a prime number. And about the multiplication, you might be interested in prime factorization. Sep 23 '19 at 18:10
• @AndrewT. To be exact, 1 is never considered a prime number. Sep 23 '19 at 19:16
• Also, while `3/2` is very close to a fifth, it's not the same (assuming tempered tuning). `4/3`, by extension, is not exactly a fourth either. `5/4` gets a bit further off from the tempered major third, and `7/4` is most definitely nowhere near the minor seventh. The true fractions are all irrational and powers of the twelfth's root of 2. Sep 23 '19 at 23:25
• @CarlWitthoft 1 has been considered prime in the past, however. Sep 24 '19 at 13:46