*This article is a preview from the Summer 2017 edition of New Humanist. You can find out more and subscribe here.*

Maryam Mirzakhani did not enjoy mathematics to begin with. She dreamed of being an author or politician, but as a top student at her all-girls school in Tehran she was still disappointed when her first-year maths exam went poorly. Her teacher believed her – wrongly – to have no particular affinity with the subject.

Soon that would all change. “My first memory of mathematics is probably the time [my brother] told me about the problem of adding numbers from 1 to 100,” she recalled later. This was the story of Carl Gauss, the 18th-century genius whose schoolteacher set him this problem as a timewasting exercise – only for his precocious pupil to calculate the answer in a matter of seconds.

The obvious solution is simple but slow: 1+2+3+4. Gauss’s solution is quicker to execute, and far more cunning. It goes like this: divide the numbers into two groups: from 1 to 50, and from 51 to 100. Then, add them together in pairs, starting with the lowest (1) and the highest (100), and working inwards (2+99, 3+98, and so on). There are 50 pairs; the sum of each pair is 101; the answer is 5050. “That was the first time I enjoyed a beautiful solution,” Mirzakhani told the Clay Mathematics Institute in 2008.

Since then, her appreciation for beautiful solutions has taken her a long way from Farzanegan middle school. At 17 she won her first gold medal at the International Mathematics Olympiad. At 27 she earned a doctorate from Harvard University. The Blumenthal Award and Satter Prize followed, and in 2014 she became the first woman to be awarded the Fields Medal, the highest honour a mathematician can obtain.

Before this particular brand of wonder became perceptible to Mirzakhani, she experienced feelings many of us can relate to: to the indifferent, her subject can seem “cold”, even “pointless”. Yet those who persist will be rewarded with glimpses of conceptual glory, as if gifted upon them by a capricious god: “The beauty of mathematics,” she warned, “only shows itself to more patient followers.”

This concept of “beauty” found in maths has been referred to over centuries by many others; though, like beauty itself, it is notoriously difficult to define. Mirzakhani has compared her work to novel-writing (“There are different characters, and you are getting to know them better”); Einstein thought it “the poetry of logical ideas”; Bertrand Russell saw this “supreme beauty” as more statuesque (“a beauty cold and austere, like sculpture… sublimely pure”).

Paul Erd?s, the Hungarian mathematician, thought it futile to attempt to explain it: “It’s like asking: ‘Why is Ludwig van Beethoven’s Ninth Symphony beautiful?’ If you don’t see why, someone can’t tell you.”

Well, they could have a go. Back in the sixth century BCE, Pythagoras made an early attempt at studying the harmonic ratios of music. Halving the length of a plucked lute string, he found, raised the note sounded by an octave. Similarly, striking an anvil with a hammer double the weight of another would produce a note an octave lower. These, and more complex relationships, form the heart of music theory. As Stravinsky once remarked of music: “Mathematics swims seductively just below the surface.”

Some two centuries after Pythagoras, Euclid would describe another of these harmonic ratios: the “golden ratio” (roughly equivalent to 1.618), the divine proportion embodied in the columns of the Parthenon, in the penstrokes of Leonardo da Vinci’s “Vitruvian Man” and brushstrokes of the “Mona Lisa”, and in the stark, glass-fronted walls of the UN’s Le Corbusier-designed Secretariat.

Yet, say the experts, mathematics is not merely a means to describe aesthetics: a formula or theorem has an integral beauty. “There are different kinds of beauty in mathematics,” says Alex Bellos, whose new book Visions of Numberland offers a gallery of colour-your-own mathematical patterns chosen either for their attractive appearance or because they demonstrate an abstract beauty. “Evidently some patterns are beautiful, but that is not what most mathematicians mean when they talk about the beauty of mathematics. For me, the beauty of mathematics is the thrilling conceptual elegance, which often involves elements of surprise, economy, depth, relevance and power.”

Euler’s identity, for example – eiπ + 1 = 0, an equation that combines five of the most important numbers in mathematics – is often cited, both by individual academics and in wider polls, as the most beautiful equation of all time. Stanford mathematician Keith Devlin has likened it to “a Shakespearean sonnet that captures the very essence of love, or a painting that brings out the beauty of the human form that is far more than just skin deep”.

This depth, which connects elements of maths that previously seemed unconnectable, and its elegant concision are at the heart of its appeal, explains Bellos. Pythagoras’s famous theorem, on the other hand (a2 + b2 = h2, the method by which we might calculate the lengths of the sides of a right-angled triangle, as per GCSE maths), “is beautiful because it is so simple, and so powerful,” he continues. “It’s where it all begins.”

Both of these equations featured in a 2014 study led by UCL neurobiologist Professor Semir Zeki, which found that that self-reported experience of mathematical beauty in mathematicians correlated with activity in the same part of the brain (the medial orbito-frontal cortex, part of the emotional brain’s pleasure and reward centre) as the experience of beauty derived from art or music. What is more, Zeki tells me, “the intensity of activity there during the experience of mathematical beauty is also proportional to the declared intensity of the aesthetic experience.”

That is to say: activity in the brain of a trained mathematician admiring a great equation looks very similar to that of an art enthusiast in a gallery. Perhaps this is why visitors to the Metropolitan Museum of Art in New York recently found ten mathematical expressions adorning the walls, selected for their beauty by leading mathematicians and physicists. The results, written in chalk on black paper and framed as works of art, include the Index Theorem (selected by Sir Michael Atiyah, winner of both the Fields Medal and Abel Prize) and the Ree Group Formula (as chosen by Enrico Bombieri, also a Fields Medallist).

That each professor selected a different formula or theorem indicates a level of subjectivity. When designing his experiment, Zeki selected a range of 60 equations, which he then asked subjects to rate on a scale of -5 (ugly) to +5 (beautiful). Euler’s identity and Pythagoras’s theory were among those most consistently rated as beautiful, along with the Cauchy-Riemann equations used in complex analysis. “There are many mathematical equations which participants regretted were not in the list, because they had found them to be so beautiful,” recalls Zeki.

The findings clearly indicate the sensation of viewing aesthetic beauty, he adds – as opposed, say, to the sense of the “sublime” experienced in vast landscapes, which he has studied in previous work. This was, perhaps, surprising: Immanuel Kant supposed that this should be the category that the concept of infinity, in mathematics for example, should naturally fall under.

Srinivasa Ramanujan’s infinite series was at the other end of the scale, rated the ugliest, as was Riemann’s functional equation. That’s a shame, says Ian Stewart, professor of mathematics at Warwick University, but perhaps not surprising: “Ramanujan seemed to have a different angle on things from everyone else. Some of his formulas are very elegant [...] Others (such as his ‘mock theta’ functions) look pretty daunting at first sight, and seem plucked from thin air. But mathematicians are starting to discover hidden depths in some of those ideas and their beauty grows as we understand more. Call it an acquired taste.”

Put like that, the whole field of mathematics might be considered an acquired taste. There’s a technical barrier to appreciating the beauty of maths that does not exist to the same extent in art, or music. “I doubt you can appreciate it the way mathematicians do,” Stewart admits. “Not in depth. But by reading the right books and articles, a layperson might get a sense of what’s involved. It’s a bit like reading poetry in a language you don’t speak: someone has to translate it for you.”

It is not simply a case of understanding the work, but comprehending its impact. “I don’t think I can assess the beauty of an equation unless I have quite a deep understanding of the mathematical ideas it records,” says professor Vicky Neale, Whitehead Lecturer in Mathematics at the University of Oxford. “Euler’s identity and the Pythagorean identity are familiar to anyone who has done some undergraduate mathematics, but lots of people will have specialised in areas that mean that they didn’t study the functional equation for the Riemann zeta function and so to them the equation might look complicated and obscure and fiddly.”

I may never be able to fully comprehend the beauty – or ugliness – of Riemann’s functional equation. But laypeople seeking a first glimpse of mathematical splendour don’t need to go back to school. It’s can simply be a matter of truly thinking about basic mathematical building blocks that we take for granted.

“Before we had Arabic numerals, we used Roman numerals, which are ugly and cumbersome,” says Bellos. It was a mathematical dark age: barely anyone could compute even basic sums. “To write ten thousand, you had to write MMMMMMMMMM. Horrible. Then all of a sudden you can write the same number with half the number of digits – 10,000 – and you get an instant understanding of the number by its length. We take Arabic numerals for granted but really they are a beautiful idea: elegant, efficient, and powerful.”

And for the connoisseur, a life of complex conceptual appreciation awaits, says Stewart: “Reading the work of a great mathematician is like watching a grandmaster play chess: the game unfolds in an elegant, sometimes surprising way, with an effective climax. Or like watching a craftsman at work. They get amazing results that the rest of us can only dream of.”