Understanding Integer Partitions
An integer partition of a positive integer n is a way of writing n as a sum of positive integers. The order of summands does not matter.
For example, the partitions of 4 are: 4, 3+1, 2+2, 2+1+1, and 1+1+1+1. That's p(4) = 5 partitions.
The partition function p(n) grows rapidly. There is no simple closed-form formula, but recursive formulas and asymptotic approximations exist.