Hi

Just wondering how to get a generating function to tell me the total number of combinations that add up to a particular number as follows.

1. 4 numbers added together that have a total of say 20.

2. The 4 numbers used must all be different and must be contained between say 1 and 30 inclusive.

e.g.

a+b+c+d = 20

1+2+3+14 = 20

cannot have 1+1+2+17 = 20

Not sure how to do this? Any ideas?