Given a set of whole numbers $\{1,\ldots,k\}$, how many combinations of the set add to integer $N$?

48 Views Asked by At

For a set of whole numbers from $1$ to $k$, how many combinations can be made that add to $N$? I had half solved this problem not too long ago, and when plotted on a table I got a diagonal representation of the Pascal triangle. so I'm wondering if I did it correctly, and if so, why did Pascal's triangle appear? Numbers are allowed to repeat. So $1+1+1$ is a valid solution for $k=5$, $N=3$. Order does not matter, so $2+3$ and $3+2$ would be considered the same solution.