If i have 3 apples and 2 buckets I could organize them as follows: 

* 1 apple in bucket A and 2 apples in bucket B
* 2 apples in bucket A and 1 apple in bucket B
* 3 apples in bucket A and 0 apples in bucket B
* 3 apples in bucket B and 0 apples in bucket A

etc..

I am trying to cook up some kind of program that will generate such combinations for me when the number of apples can be any number and the number of buckets can also be any number. My gut tells me that there will be some recursion involved but, i can't even get started. Can someone point me in the right direction?