The highlight of the 13th and final book of Euclid's Elements was the proof that there are just five "Platonic solids". Recall that a regular polygon is a plane figure with all sides and angles equal, for example a square. By joining identical polygons together, we can form solid bodies called regular polyhedra.

Thus, with six squares we can make a cube. Four equilateral triangles make a tetrahedron, eight make an octahedron and 20 make an icosahedron. The fifth and final regular polyhedron is the dodecahedron, with 12 pentagonal faces.

Plato used the regular polyhedra in an early atomic model, and we still speak of the Platonic solids. Archimedes discovered that by using more than one type of polygon he could form 13 new “semi-regular” solids. Much later, Kepler constructed a magnificent but incorrect model of the solar system using the Platonic solids.

A simple property of all these shapes escaped the notice of the ancient mathematical luminaries. If we denote the number of vertices, edges and faces by V, E and F respectively, then:

V – E + F = 2

This relationship was found by the Swiss mathematician Leonhard Euler in 1750, and is now called Euler's polyhedron formula or, more colloquially, Euler's Gem.

And a gem it is: although simple enough to explain, the formula has sweeping implications throughout mathematics, with repercussions in topology, network analysis and dynamical systems theory.

It is easy to check that a cube has eight vertices, 12 edges and six faces, so the formula holds. But it applies much more generally. Any surface can be divided up into a mesh of interlocking triangular pieces; cartographers construct maps using this process of triangulation. Thus, a curved surface is approximated by a polyhedron with flat faces. No matter how the globe is triangulated, Euler’s formula holds.

Euler’s Gem provides a bridge between geometry and topology. In geometry, lengths and angles are fixed. We can move shapes around but no distortion is permitted. Topology is geometry with rigidity relaxed. Shrinking and stretching are allowed, though no tearing or gluing. So, a sphere and cube are topologically equivalent: a round ball of plasticine can be squashed into cubic shape. But a sphere and torus (doughnut shape) are distinct: we cannot change one into the other without making or filling a hole.

A torus can be triangulated just like a sphere, but now Euler’s number X = V – E + F becomes 0 instead of 2. More generally, if we triangulate a surface and find Euler’s number X, we can be sure that there are N = ( 1 – X / 2 ) holes in it.

Euler's formula has some sporting implications. One brand of golf ball has 232 polygonal dimples, all hexagons but for 12 pentagons. And the football popularised in the 1970 World Cup in Mexico was based on a truncated icosahedron with 20 hexagons and 12 pentagons. Since then, chemists have synthesised a molecule of this shape comprising 60 carbon atoms, earning a Nobel Prize and starting a new field of chemistry.

Some computer models used to simulate the Earth’s climate utilise hexagonal meshes to achieve a uniform distribution throughout the globe, circumventing the problem of polar clustering with conventional latitude-longitude grids. But hexagons alone will not suffice. Euler’s formula constrains all these grids to have precisely 12 pentagons.

Peter Lynch is professor of meteorology at University College Dublin. He blogs at thatsmaths.com