For illustration, let us consider the specific case of N=5, and k=3. For the above-mentioned partitions one has [2]:
{5,0,0}, {4,1,0}, {3,2,0}, {3,1,1}, {2,2,1}.
-- {5,0,0} implies that the available 5 particles can be in one of the 3 energy levels. For this there are 3 distinct possibilities: [5,0,0], [0,5,0], [0,0,5]. Here [i,j,k] denotes a state with i particles in level 1, j particles in level 2, and k particles in level 3.
-- {4,1,0} implies that 4 particles can be placed in one energy level and the remaining 1 particle in another energy level. For this there are 6 distinct possibilities: [4,1,0], [4,0,1], [0,4,1], [1,4,0], [1,0,4], [0,1,4].
-- {3,1,1} implies that 3 particles can be placed in one energy level and the remaining 2 particles in two remaining energy levels. For this there are 3 distinct possibilities: [3,1,1], [1,3,1], [1,1,3].
-- {2,2,1} implies that two pairs of particles can be placed in two distinct levels and the remaining one particle in the remaining level. For this there are 3 distinct possibilities: [2,2,1], [2,1,2], [1,2,2].
Denoting the total energy by E, and those of the three levels by E1, E2 and E3, with Ai = exp(-Ei/kBT), i=1,2,3, for the problem at hand one has (under the assumption that particles [here bosons] are indistinguishable):
where the denominator is the partition function of the problem at hand. At T=∞, one obtains E = 25(E1+E2+E3)/17, which reflects equipartitioning in the 'classical' region, and, for E1 > E2, E3, at T=0 one appropriately obtains E = 5 E1.
Incidentally, physically the relevant quantity to be considered is not the energy E, but the Helmhotlz free energy F = E - TS. For this, one needs to calculate the entropy S. This calculation is carried out along the lines of the calculation of E described above.
________
[1] J. Riordan, Introduction to Combinatorial Analysis (Dover, New York, 2002).
[2] I write down the zeros to indicate empty energy levels.