I am scratching my head trying to do this and it\'s eating me up. I know it is not THAT complex. I have a number of items, this number can be equal or greater than three. Then I
What you are describing is a less general version of the partition function.
The algorithms already given are ridiculously complicated, here is a simpler one (in pseudo-code, I will leave it up to you to translate to Java :)
)
p(min, n):
if min > n: return 0
if min = n: return 1
return p(min+1, n) + p(min, n-min)