§ Integer partitions: Recurrence


An integer partition of an integer nn is a sequence of numbers p[1],p[2],p[n]p[1], p[2], \dots p[n] which is weakly decreasing: so we have p[1]p[2]p[n]p[1] \geq p[2] \dots \geq p[n]. For example, these are the integer partitions of 55:

Thus, P(5)=7P(5) = 7. We denote by P(n,k)P(n, k) the number of partitions of nn into kk parts. So we have P(5,1)=1P(5, 1) = 1, P(5,2)=2P(5, 2) = 2, P(5,3)=2P(5, 3) = 2, P(5,4)=1P(5, 4) = 1, P(5,5)=1P(5, 5) = 1.
The recurrence for partitions is:
P(n,k)=P(n1,k1)+P(nk,k)P(n, k) = P(n-1, k-1) + P(n-k, k)

The idea is to consider a partition p[1],p[2],,p[k]p[1], p[2], \dots, p[k] of nn based on the final element:

§ References