# Combinations of n items that fill the entire volume

I have a problem and I just cannot derive the general solution.

There is a large box of volume n. We have many small boxes of volume <= n (1, 2, 3 ... n). All the volumes are positive integers. Shape of the boxes isn't relevant, the volume is.

Given the volume of a large box (n), how many different combinations of smaller boxes that fill up the large box are there?

Example:

n=2;

small box of voulme 1 + small box of volume 1 = 2

small box of volume 2 = 2

all in all 2 combinations

n=3;

1 + 1 + 1 = 3

1 + 2 = 3

3 = 3

all in all 3 combinations

n=4;

1 + 1 + 1 + 1 = 4

1 + 1 + 2 = 4

1 + 3 = 4

2 + 2 = 4

4 = 4

all in all 5 combinations

The problem does feel similar to the How many sums from the combination of coins?, however there are many more item/coin volumes/values to choose from.

Any solution/help is appreciated.

Thank you

• I believe this is called Partitions of $n$. Look it up. Commented Apr 3, 2018 at 9:57
• Indeed, it is a bit of a difficult task. Commented Apr 3, 2018 at 9:58
• If you formulate it this way (with boxes), you should take into account their shape, whereas I think you are really just interested in partitions of $n$ Commented Apr 3, 2018 at 10:00
• I could clearify that the shape doesn't play a role. Thank you for the answers. It does seem that 'Partitions of n' is the solution. I found a resource online here Commented Apr 3, 2018 at 10:06

For $n=k$, it is the coefficient of $x^k$ in:
$$\prod_{i=1}^k \frac1{1-x^i}$$
What you trying to calculate is partition number $p(n)$.
In general partition number is unknown for now. We know only generating function (function coefficients in power series of which give us partition number). Also there is generated a huge number of partitions (https://oeis.org/A000041). But for general $n$ the task is undecidable.