- #1
mnb96
- 715
- 5
Hello,
is there a straightforward way, or some well-known expression to count how many ways there are of choosing N positive integers [itex]a_1,\ldots,a_N[/itex] such that [itex]a_1+\ldots+a_N = X[/itex] (where X is some fixed positive integer).
Note that if N=2, and X=10 (for example), I consider the pairs 1+9 and 9+1 (for instance), as being two different ways of obtaining X=10, as well as 2+8 and 8+2, or 3+7 and 7+3, and so on...
For N=1 there is obviously only 1 choice.
For N=2 the result should be: X-1 ways.
For N=3 it is (X-1)(X-2)/2
...For N>3 things get more complicated...
is there a straightforward way, or some well-known expression to count how many ways there are of choosing N positive integers [itex]a_1,\ldots,a_N[/itex] such that [itex]a_1+\ldots+a_N = X[/itex] (where X is some fixed positive integer).
Note that if N=2, and X=10 (for example), I consider the pairs 1+9 and 9+1 (for instance), as being two different ways of obtaining X=10, as well as 2+8 and 8+2, or 3+7 and 7+3, and so on...
For N=1 there is obviously only 1 choice.
For N=2 the result should be: X-1 ways.
For N=3 it is (X-1)(X-2)/2
...For N>3 things get more complicated...