I have $n$ non-unique elements, and I have $k$ unordered buckets that can hold anywhere from $0$ to $c$ elements, such that $c * k \geq n$. I would like to find all possible combinations.
For example, given $n=10$, $k=4$, and $c=4$, there are 7 possible distributions:
where "3322", for example, means that two buckets have three elements each and the other two buckets have two elements each.
Another way to look at it, is that I want to find unique combinations of $k$ numbers less than or equal to $c$ such that their sum is equal to $n$.
Ideally I'd like an algorithm to be able to generate a list of all acceptable combinations, but knowing a formula for finding the number of combinations given arbitrary $n$, $k$, and $c$ would be helpful. Other answers generally assume buckets have to have a minimum capacity of 1, or they deal with unique elements to some degree, which are not the case here.