Number of all finite sequences of positive integers that add up to 100 (with some constraints)

56 Views Asked by At

Find the number of all finite sequences of integers $n_1, n_2, \ldots, n_k$, such that $$ n_1 + n_2 + ⋯ + n_k = 100 $$ and such that for every $i \in \{1,\ldots,k\}$ we have $n_i \ge i$.

I have been thinking about this for days but I still do not understand how to begin. Please help.

1

There are 1 best solutions below

3
On BEST ANSWER

Possible approach / might not be the fastest way.

Fix a certain $k$, then the problem becomes finding non-negative integers $a_i = n_i - i$ s.t.

$$\sum a_i = 100 - \frac{k(k+1)}{2}$$

which can be solved by stars and bars. Then just loop through all possible values of $k$. Can you finish from here (if this approach is OK with you)?