Why do people make scholarly studies of Shakespeare's plays, Rembrandt's paintings, or Beethoven's symphonies? Quite simply, because we recognise in these works a beauty that can be inspirational. They inspire study to those so inclined, as does mathematics despite the fact that most people do not find it at all beautiful. Yet obviously some do, as a recent UCL study confirmed, so what is it about mathematics that makes it beautiful?
Ask this question of different mathematicians and you will get different answers. Some are inspired by geometry, others by algebra. Some think geometrically, others more algebraically, though I know no grounds for supposing any difference in the ways their brains function. My thinking is geometric, and as a child I could see, in a pictorial way why the product of two negative numbers was a positive number. That was beautiful, though a beauty that one could not easily share with others. This is the trouble with beauty — it is in the mind of the beholder, and particularly in mathematics it can be hard to explain it to others.
Sometimes one can explain the beauty of a result, but the other type of beauty — a beautiful way of proving that result, a way that appeals to our sense of symmetry, proportion and elegance — can be harder to get across. A good example is Pythagoras's Theorem for a right-angled triangle, which is usually stated as: the square on the hypotenuse (the slanting side) is equal to the sum of the squares on the other two sides. The most well-known example of such a triangle is one whose sides have lengths 3, 4 and 5, where of course 3 squared+4 squared =5 squared, though there is an infinite array of other examples with whole numbers and different ratios of side lengths.
This is a beautiful result, stated and proved in Euclid's famous treatise on geometry written in about 300 BC, but Euclid's proof is ugly. Since his time, and possibly before, more elegant proofs have been given, and the mere existence of such proofs speaks about the beauty of the result. If it weren't beautiful why would anyone want to find a better proof? But many people have been fascinated by the result, including US President Garfield in 1876. I have my own proof, which is to me a thing of exquisite beauty, and I once looked on the internet to see if it was there — there are zillions of proofs of Pythagoras's Theorem on the internet — but I didn't find it.
Leaving aside geometry, here is an elegant result that usually astonishes students when they first see it. Consider all prime numbers larger than 2. Which ones can be written as a sum of two squares? Each one is an odd number, so its remainder after dividing by 4 is either 1 or 3, and the result is very simply stated. Those having a remainder of 1 are sums of two squares (in a unique way), and those having a remainder of 3 are not. For example, 5 has a remainder of 1 and is equal to 1 squared + 2 squared but 7 which has a remainder of 3 is not a sum of two squares. Try a few examples and you may agree that this is indeed rather beautiful.