# Different ways to divide identical objects into groups

This question has been asked in different forms but I couldn't find a satisfactory answer (this came close but not close enough).

Assume I have 4 marbles. There are effectively only 5 ways of dividing them into groups of size at least 1 and at most 4:

1) o o o o
2) o o oo
3) o ooo
4) oo oo
4) oooo


I am wondering if there is a generalized formula for this? The key element here is that the groups can but not must be the same size and that the elements are identical (i.e. ooo o and o ooo are identical).

• Are you just after the partition function?
– lulu
Sep 2, 2018 at 12:08
• Actually yes, however I'm not sure I understand how to apply the formula for an integer n... Sep 2, 2018 at 12:25
• The partition function famously hasn't got a simple, closed form. That's why it is so extensively written about. Read the link I suggested, search online for more discussion. Not sure what it is that you are hoping for here.
– lulu
Sep 2, 2018 at 12:28
• Actually that did help! Yours should be the accepted answer, thanks! Sep 2, 2018 at 15:41