Formulas were also ranked by their beauty, with the greatest compared to a soliloquy by Hamlet

The brain responds to mathematical beauty in the same way that it does to music and art, according to new research conducted by a team from University College London.

After analysing the reactions of 15 mathematicians to formulae through brain imaging, researchers found that the brain reacts similarly to seeing a beautiful equation as it does to magnificent art or music.

“When one looks at a formula rated as beautiful it activates the emotional brain - the medial orbito-frontal cortex - like looking at a great painting or listening to a piece of music,” said Professor Semir Zeki, lead author of the paper.

Professor Zeki, from the Wellcome Laboratory of Neuriobiology at UCL, added: “To many of us mathematical formulae appear dry and inaccessible but to a mathematician an equation can embody the quintescence of beauty."

One mathematician reported feeling “a shiver of appreciation” when seeing a beautiful equation. Another said that viewing an equation was similar to “hearing a beautiful piece of music, or seeing a particularly appealing painting”.

As part of the study, the mathematicians also ranked 60 different formulae as either ‘beautiful’,  ‘ugly’, or ‘indifferent’. According to this ranking the most beautiful formula is Euler’s identity, which was deemed so aesthetically pleasing that it was compared to one of Hamlet's soliloquies.

Euler's identity is expressed as and is notable for combining the fields of geometry and algebra by using five funadmental mathmatical constants and three of the basic arithmetic operations. The latter trio are addition, multiplication and exponation, and the former quintet are e and π (both are transcendental numbers), i (the 'imaginary number), 0 and 1.

And for non-mathematicians hoping for a more accessible example, Pythagoras' theorem was also ranked highly. This formula () is used to work out the sides of a right-angled triangle and is often expressed as the statement 'the square of the hypotenuse is equal to the sum of the squares on the other two sides'.

Perhaps it is for this reason that the philosopher and mathematician Bertrand Russell declared that the discipline was "capable of an artistic excellence as great as that of any music, perhaps greater":

"[Mathematics] gives in absolute perfection that combination, characteristic of great art, of godlike freedom, with the sense of inevitable destiny; because, in fact, it constructs an ideal world where everything is perfect but true," wrote Russel in his 1967 autobiography.

This study appears in the journal Frontiers in Human Neuroscience