The Maths and Music of the Magic Flute

Presented by Professor Marcus Du Sautoy



Marcus du Sautoy is the Charles Simonyi Professor for the Public understanding of Science and Professor of Mathematics at the University of Oxford, and a Fellow of New College. He is the author of three books: The Music of the Primes, Finding Moonshine and most recently The Number Mysteries. He has presented numerous radio and TV series including a four-part landmark TV series for the BBC called “The Story of Maths”, a three-part series called “The Code” and programmes with comedians Alan Davies and Dara O Briain. He spent time at the Royal Opera House last year as a trainee conductor as part of the BBC TV series “Maestro at the Opera”. He gave the Royal Institution Christmas Lectures in 2006, broadcast on Channel 5. He writes regularly for The Times, Daily Telegraph, Independent and the Guardian and for several years had a regular column in The Times called “Sexy Science”. In 2001 he won the prestigious Berwick Prize of the London Mathematical Society, awarded every two years to reward the best mathematical research made by a mathematician under 40. In 2004 Esquire magazine chose him as one of the 100 most influential people under 40 in Britain. In 2009 he was awarded the Royal Society’s Michael Faraday Prize, the UK’s premiere award for excellence in communicating science. He received an OBE for services to science in 2010 New Year’s Honours list.

Introduction by Professor Du Sautoy

The story of Die Zauberflöte (The Magic Flute) involves a simple quest for love and enlightenment. Prince Tamino falls in love with a portrait of Pamina, the Queen of the Night’s daughter, and sets off to find her, accompanied by his comic sidekick Papageno the bird catcher. At the heart of the opera are the trials that Tamino and Pamina must undergo in order to win each other’s love and enlightenment. I hope to take you through your own series of mathematical trials to provide you with perhaps a new insight into the strange mathematical symbolism that runs through this enigmatic opera, the last of Mozart’s to be performed in his lifetime. Mathematics, in my view, is not a spectator sport. So join in our exploration of the mathematical ideas bubbling beneath this beautiful opera. This is an interactive and immersive performance of the mathematics and music of Mozart. The opera starts in the realm of the Queen of the Night, a world of chaos and darkness. But Tamino’s journey brings us to Sarastro’s kingdom, where light and order reign. Mozart had been initiated into the Masons seven years before he wrote The Magic Flute and one can detect many parallels between Sarastro’s society and the Masonic order that Mozart had joined. Mathematical ideas are integral to the rituals of the Masons and we can see Mozart playing with these ideas throughout the opera. One of the central themes, both to the Masons and to The Magic Flute, is the movement from chaos to order. This is Mozart writing at a crucial moment in history both politically and musically. The work was given its premiere in Vienna in 1791, two years after the revolution that swept the streets of Paris. The trials that Tamino and Pamina will undergo are representative of this transition in society. But this is also a statement of a musical revolution. Mozart is a few months from his death. In this opera he is laying out his vision for the music of the future. He is leaving behind the Baroque coloratura of the music of the Queen of the Night and taking music into a new dimension.



Before Professor Du Sautoy started his presentation he demonstrated the “magic” maths handshake (how mathematicians identify each other). This involved moving the right hand up and down once with the first finger extended, then moving it up and down with three fingers extended and finally moving it up and down with the whole hand extended.

The presentation started with the overture from the opera                                                whilst the performers used sticky tape to form sets of triangles, overlapping them until a twelve pointed star was formed.


The star points touched a readymade circle.

Professor Du Sautoy introduced his talk by saying how Gottfried Wilhelm Leibniz believed there was a connection between mathematics and music.

Musica est exercitium arithmeticae occultum nescientis se numerare animi. Music is a hidden arithmetic exercise of the soul, which does not know that it is counting. Leibniz’s letter to Christian Goldbach, April 17, 1712.

Jean-Philippe Rameau saw a connection between mathematics and music which he used to develop his twelve note scale.

Treatise on Harmony, 1722                                                                        Rameau’s 1722 Treatise on Harmony initiated a revolution in music theory.Rameau posited the discovery of the “fundamental law” or what he referred to as the “fundamental bass” of all Western music. Rameau’s methodology incorporated mathematics, commentary, analysis and a didacticism that was specifically intended to illuminate, scientifically, the structure and principles of music. He attempted to derive universal harmonic principles from natural causes. Previous treatises on harmony had been purely practical; Rameau added a philosophical dimension, and the composer quickly rose to prominence in France as the “Isaac Newton of Music.”His fame subsequently spread throughout all Europe, and his Treatise became the definitive authority on music theory, forming the foundation for instruction in western music that persists to this day.


Pythagoras is believed to have discovered that musical notes could be translated into mathematical equations when he passed a blacksmith at work. He is supposed to have gone to the blacksmiths to learn how this had happened and by looking at their tools discovered that it was because the hammers were “simple ratios of each other, one was half the size of the first, another was 2/3 the size, and so on.” This has proved to be false by virtue of the fact that these ratios are only relevant to string length (such as the string of a monochord), and not to hammer weight. However, it may be that Pythagoras was indeed responsible for discovering these properties of string length.

A level physics students investigate the relationship between string length and notes indirectly when they are investigating standing waves.


In the above picture the first standing wave is classed as the fundamental (first harmonic). The second standing wave is an octave higher (first overtone and second harmonic) and the third (second overtone and third harmonic). A harmonic of a wave is a component frequency of the signal that is an integer multiple of the fundamental frequency. The frequency is defined as the number of vibrations per second.

The perfect fifth                                                                                   Hemiola is the ratio of the lengths of two strings, three-to-two (3:2) that together sound a perfect fifth. The justly tuned pitch ratio of a perfect fifth means that the upper note makes three vibrations in the same amount of time that the lower note makes two. In the cent system of pitch measurement, the 3:2 ratio corresponds to approximately 702 cents, or 2% of a semitone wider than seven semitones. The just perfect fifth can be heard when a violin is tuned: if adjacent strings are adjusted to the exact ratio of 3:2, the result is a smooth and consonant sound, and the violin is felt to be “in tune”. Just perfect fifths are the basis of Pythagorean tuning, and are employed together with other just intervals in just intonation. The 3:2 just perfect fifth arises in the justly tuned C major scale between C and G.

Twelve members of the audience were asked to stand on the circumference of the circle (mentioned earlier) at the points where the star touched the circumference to represent the members of the chromatic scale of notes. Chromatic scale is drawn as a circle below: each note is equidistant from its neighbours, separated by a semitone of the same size.

The chromatic scale is a musical scale with twelve pitches, each a semitone above or below another. On a modern piano or other equal-tempered instrument, all the semitones are the same size (100 cents). In other words, the notes of an equal-tempered chromatic scale are equally spaced. An equal-tempered chromatic scale is a nondiatonic scale having no tonic because of the symmetry of its equally spaced notes.



(3/2)^12 = 1.5^12 which is approximately 2^7

The most common conception of the chromatic scale before the 13th century was the Pythagorean chromatic scale. Due to a different tuning technique, the twelve semitones in this scale have two slightly different sizes. Thus, the scale is not perfectly symmetric. Many other tuning systems, developed in the ensuing centuries, share a similar asymmetry. Equally spaced pitches are provided only by equal temperament tuning systems, which are widely used in contemporary music.

Different cultures use different numbers to 12. Indonesia has 53.

The performers continued with the opera at the point where Tamino is chased by the serpent and the audience formed the serpent. Three mysterious ladies appear to save him.

Mozart loved mathematics. Johann Andreas Schachtner, court trumpeter and friend of the Mozart family, wrote about the young Wolfgang: “When he was doing sums, the table, the chair, the walls and even the floor would be covered with chalked numbers.”

As an adult Mozart’s obsession with numbers didn’t wane. He would scatter numbers throughout his letters to family and friends. His family used a secret code to keep politically sensitive comments from the eyes of the censors. But he also used numbers in more intimate exchanges. His kisses would invariably be issued in units of 1,000, although sometimes he would choose a more interesting selection of numbers to shower his correspondent with.

The curious string of numbers 1095060437082 appears in a letter to his wife Constanze. One decoding that has been offered of this sequence suggests we add 10+9+50+60+43+70+82 to get 324, which is 18 squared, again like the opening of Figaro, expressing the bond of love between Mozart and Constanze. He signed himself in another letter as “Friend of the House of Numbers”; while Constanze told a biographer after Mozart’s death about “his love of arithmetic and algebra”.

What’s the next number in this sequence? 5, 10, 20, 30, 36 … ? And the next in this? 640, 231, 100, 91 … ?

If you know your Mozart then you’ll identify 43 as the number that comes after 36 in the first sequence. These are the opening lines of The Marriage of Figaro sung by Figaro as he measures out the room that he will share with Susanna once they are married. It’s a curious selection of numbers that when added together comes to 144, or 12 squared: perhaps a coincidence or maybe a numerical representation of the impending union of Figaro and his bride Susanna.

The second sequence continues with 1,003, the number of Don Giovanni’s female conquests in Spain. The other numbers are part of the famous Catalogue aria sung by Leporello, Don Giovanni’s servant, which include his other conquests: 640 in Italy, 231 in Germany, 100 in France, 91 in Turkey.

The number three runs throughout The Magic Flute. There are also references to freemasons (freemasons were involved with politics) and there is a connection between mathematics and freemasonry. It is the work most laden with symbolism and numerical imagery. The opera is full of masonic symbols, which in turn are underpinned by mathematics – Mozart had been admitted to Beneficence lodge in Vienna seven years earlier. The number three, for example, is very significant in masonic practice. The three knocks at the lodge door that are part of the initiation ceremony for a new mason are heard again and again throughout the opera. As Goethe, a fellow mason, declared: “The crowd should find pleasure in seeing the spectacle: at the same time, its high significance will not escape the initiates.”

Beyond the three-note rhythm sequence the number three is threaded through the opera in numerous ways. Much of Mozart’s masonic music is written in E flat major, a key with three flats, although this may have more to do with the key being best suited for the wind instruments that Mozart employed. Many of the characters come in threes: the three ladies who serve the Queen of the Night, the three boys. Three-part harmony abounds.

The opera is also full of pairs (two is considered a feminine number) such as day and night, fire and water, Osiris and Isis, Queen or Sarastro, gold and silver, 3 or 5, chaos or pattern, black or red, establishment or rebellion, glockenspiel or flute, sun and moon, pairs of conflicts, pairs of pictures and pairs of oppositions.

Papageno and Pamina sing a duet which shows the importance of pair in the opera.

The number five plays a part, another important number for the masons given their choice of the symbol of the pentagram or five-pointed star. Trios give way to quintets, not quartets. And ultimately Sarastro’s power is bound up in the mystical seal of the seven circles of the sun.

For Mozart The Magic Flute is also a statement of his belief in a changing order, not just politically but also musically (the chaos of the Queen of the Night to the order of Sarastro). The work premiered in Vienna in 1791, two years after the revolution that swept the streets of Paris. The masonic order had suffered repression because the authorities feared the enlightened ideas this secret society was promoting. This transition from ancient regime to enlightenment is captured in the music. The ornate music (baroque) of the Queen of the Night gives way to a new sound that Mozart hoped would be his legacy. Showing superstition changing to science.

In the opera Tamino wakes up to see the ladies in the service of the Queen of the Night. He sees a picture of Pamina and falls in love with her but he is told he needs to go through trials and quests to rescue her. Professor Du Sautoy gave him a maths book and made him solve problems as one of the trials. On a screen a sequence of numbers formed an image of Pamina. On top of the image squares, rectangles and spirals formed.

The audience was invited to take part in a mathematical game to “feed” the Queen of the Night. This involved each person trying to make an equilateral triangle with two other people without the others knowing. This proved to be almost impossible. This shows chaos controls the world.

Three is a masculine number used by the freemasons and its use in The Magic Flute pins Mozart to the masons, “So drink my brothers, 3 x 3 as true masons”.

The key of the opera’s overture and many arias in the work are in Eb major, the third chord in the diatonic scale, and serendipitously, a key with three flats. The opening measures of the overture, heralded by the rich texture of woodwinds, announce a theme of three harmonized chords, beginning with the tonic Eb triad, which echoes the Masonic initiate knocking three times on the Masonic lodge door to request entry, as shown:


Historically freemasons were builders.

The 47th proposition of Euclid’s first book of the “Elements”, also known as “The Pythagorean Theorem”, stands as one of Masonry’s premier symbols, though it is little discussed and less understood today. That fact is made the more unfortunate, since the 47th proposition may well be the principal symbol and truth upon which Freemasonry is based.


The Pythagorean theorem: The sum of the areas of the two squares on the legs (a and b) equals the area of the square on the hypotenuse (c).


or, for example 3 squared + 4 squared = 5 squared


In outline, here is how the proof in Euclid’s elements proceeds. The large square is divided into a left and right rectangle. A triangle is constructed that has half the area of the left rectangle. Then another triangle is constructed that has half the area of the square on the left-most side. These two triangles are shown to be congruent, proving this square has the same area as the left rectangle. This argument is followed by a similar version for the right rectangle and the remaining square. Putting the two rectangles together to reform the square on the hypotenuse, its area is the same as the sum of the area of the other two squares.

Egyptians used rope with knots to trace out the right angled triangles.

There are three stages in becoming a freemason. The three degrees of Craft or Blue Lodge Freemasonry are those of:

  1. Entered Apprentice – the degree of an Initiate, which makes one a Freemason;
  2. Fellow Craft – an intermediate degree, involved with learning; and
  3. Master Mason – the “third degree”, a necessity for participation in most aspects of Masonry.

As mentioned before there are many threes in The Magic Flute: 3 ladies; 3 cords; 3 temples (nature, reason and wisdom); E flat major with its three flats; 3 boys helping Tamino when he was lost; Sorastros domain of order, geometry and a temple to Isis/Osiris.



The Masonic Square and Compasses. (Found with or without the letter G). The 5 pointed star.

Geometrically, Classical architecture is based on the circle, straight line and square. To draw a circle, on an architectural scale, you simply need a piece of string (sacred piece of string). You anchor one end of the string, and sweep the other end around to mark out the circle (or semicircular arch). You can draw a straight line with a piece of string, too, by stretching it out tight. This also allows you to draw out a five pointed star without measurements. The performers did this.

Of course nowadays we can do this with a compass and protractor.



5 = 2 (feminine) + 3 (masculine)

In the nineteenth century mathematicians proved that a seven pointed star was impossible.

Why is all of this important to the Masons? The answer is to do architecture.

The golden ratio is hidden in a five pointed star.


A pentagram coloured to distinguish its line segments of different lengths. The four lengths are in golden ratio to one another. The value is 1.6180339887…..


a/b = (a + b)/a = φ = the golden ratio

Many 20th century artists and architects have proportioned their works to approximate the golden ratio—especially in the form of the golden rectangle, in which the ratio of the longer side to the shorter is the golden ratio—believing this proportion to be aesthetically pleasing. Mathematicians since Euclid have studied the properties of the golden ratio, including its appearance in the dimensions of a regular pentagon and in a golden rectangle, which can be cut into a square and a smaller rectangle with the same aspect ratio. The golden ratio has also been used to analyse the proportions of natural objects as well as man-made systems such as financial markets, in some cases based on dubious fits to data.

The golden ratio is perfect for buildings and can be seen in the Parthenon and Notre Dame. It is also seen in art.



image  image

Composers such as Debussy loved the golden ratio.

In the overture to The Magic Flute there are 81 bars and 130 bars. 130/81 is about 1.618

Fibonacci numbers



Above left shows tiling with squares whose side lengths are successive Fibonacci numbers. Above right shows an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes 1, 1, 2, 3, 5, 8, 13, 21, and 34.

Fibonacci numbers are closely related to Lucas numbers. They are intimately connected with the golden ratio; for example, the closest rational approximations to the ratio are 2/1, 3/2, 5/3, 8/5, … .

They are found all over the natural world.

image image

Yellow Chamomile head on the left showing the arrangement in 21 (blue) and 13 (aqua) spirals. Such arrangements involving consecutive Fibonacci numbers appear in a wide variety of plants. The Nautilus shell also has them.

clip_image001A banana shows the number 3, an apple shows the number 5 and a sharon fruit show the number 8.

image image image

Fibonacci numbers are also seen in music and the Magic Flute is no exception. The first act has 8 musical pieces and the second has 13.

A beautiful face can show the golden ratio.

There are no quartets in the Magic Flute. There is a quintet with Papagano, Tamino and the three ladies of the night. In the performance the singers had to stay on the pentagon but only two could be on each part.

Tamino is given three gifts. Papagano is given magic bells.

Tamino and Papagano arrive in Sarastro’s court. Tamino needs to carry out four trials of initiation: fire; air; water; earth (The ancient Greeks considered these as elements).

Plato said that each element had a shape. Earth is a cube, water is a icosahedron, fire is a tetrahedron and air is an octahedron.

Euclid said there are five possible shapes for a dice. Plato suggested the fifth shape was the universe (dodecahedron).


In the opera Pamina agrees to carry out the last trial (fire) with Tamino using the magic flute to help them. As two of the trials take place off stage Professor du Sautoy sets a mathematical task for the audience and performers to carry out. The audience makes the fire shape from bamboo sticks and elastic bands and the performers made the water shape.


The above picture shows the water shape. Plato believed all these shapes were the building blocks of nature. Carbon is strong because it is made of triangles.

Mozart used delicate music whilst the trials are being carried out.

Leonard Euler was called the “Mozart of Maths”. He transformed mathematics.

He worked on the fire and water symbols: 4 vertices + 4 faces = 6 + 2 and for fire and 12 vertices + 20 faces = 30 + 2.

After the final trial Tamino and Pamina sing a duet. Music is full of mathematics and precision. Mathematics gives music emotion. A union of two opposites as art and science should be united. Mathematicians like permanencies. This is as true for us today as it was for the ancient Greeks

The performance ended with the final chorus “the rays of the sun drive away the night” .

During the performance I noticed that all the performers had numbers on their T shirts and I emailed the professor to ask him about it. This is his reply:

“All the shirts were prime. I play in the 17 shirt for my local football team in East London. It’s a Fermat prime so after the pentagon we made, it’s the next prime sided shape that can be constructed with ruler and compass. It’s also key to the survival of cicadas in America. Also the number of 2 dimensional wallpaper symmetries. Also the prime Messaian used in the quartet for the End of Time…I could go on… Marcus”.

Note from me. My report of the performance does not do it justice. It was brilliant and if you ever have the chance to see it. Do. Helen Hare

2 thoughts on “The Maths and Music of the Magic Flute

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s