I have a number x and want to find how many ways there are to add up to that number using the y numbers from numbers 1-z. for example, for x=15 y=3, z=9, there are 8 ways to add up to 15 using 3 numbers chosen from 1-9 without repetition (and order does not matter):
1,5,9
1,6,8
2,4,9
2,5,8
2,6,7
3,4,8
3,5,7
4,5,6
How can i generalize this formula?