### Brief summary

The partition function is a way of calculating the number of ways you can write a natural number as a sum of smaller numbers, without explicitly writing out all the different sums.

You can write any natural number as a sum of natural numbers. For example 3 can be written as a sum in three different ways:

3=3

3=2+1

3=1+1+1

The number 4 can be written as a sum in five different ways:

4=4

4=3+1

4=2+2

4=2+1+1

4=1+1+1+1

The partition number *P(n)* of a number *n* is precisely the number of ways it can be written as a sum of natural numbers (without worrying about the order in which they are added). As we have just seen, *P(3)*=3 and *P(4)*=5.

Srinivasa Ramanujan (1887 - 1920).

Srinivasa Ramanujan was a self-taught mathematical genius whose impact on mathematics was huge.

Writing down and counting the number of ways you can write a number as a sum seems easy, but in fact it quickly gets out of hand as the number gets large. For example for the number 10, the partition number *P(10)* is 42, which is already surprisingly large. A partition function is a way of calculating the partition number as a function of n without explicitly writing out all the different ways of writing n as a sum. The brilliant self-taught mathematician Srinivasa Ramanujan was elected a fellow of the Royal Society in 1918 for his work with G.H. Hardy on such a partition function. (Find out more in *Celebrating Ramanujan*.)

In physics, partition functions arise when you study physical systems, say a room filled with gas at a certain temperature. Partition functions here provide a way to measure the *entropy* – the amount of order, or equivalently disorder – in such a system. Again this amounts to a counting problem, this time counting how many different possible arrangements of the molecules of gas in the room result in the same temperature. (You can read about more in our article *Entropy: from fridge magnets to black holes*.)

Partition functions in both physics and mathematics serve the same purpose: they provide a way of organising a collection of things. In mathematics it is a way of calculating how many possible ways there are of writing a number as a sum. In physics it is calculating how many possible microscopic arrangements of a physical system can result in the same macroscopic state.

*This article was produced as part of our collaboration with the Isaac Newton Institute for Mathematical Sciences (INI). The INI is an international research centre and our neighbour here on the University of Cambridge's maths campus. The Newton Gateway is the impact initiative of the INI, which engages with suers of mathematics. You can find all the content from the collaboration here. *