The number of $k$-compositions of a positive integer $n$ is ${n-1}\choose{k-1}$, and its number of $k$-weak compositions is ${n+k-1}\choose{k-1}$.
However, how to calculate the corresponding compositions when we restrict that the numbers of the sequence cannot be greater than a certain value?
For example, suppose we have the list of all possible tickets with numbers of $6$ digits, where each digit can be a value between $0$ and $9$, and we want to calculate in how many of them their sum is $20$. (Since they are ticket numbers, as in a lottery, they can start with zeros on the left). The result should be the $6$-weak compositions of $20$ with the restriction that the values cannot be greater than $9$.