Consider that I am given a set of $n$ integers $a_1, a_2, \ldots a_n$, which can take any value in the interval $1\leq a_i\leq t$, where $t$ is a positive integer, how can I find the number of combinations so that the sum of these $n$ integers is equal to $S$.
As an example, for 4 integers bounded as $1\leq a_i\leq 4$, the number of unordered (i.e. sequence does not matter) combinations so that $S=13$ is 3, given as (4,4,4,1), (4,4,3,2), (4,3,3,3).
It can be assumed that $t$ is choosen such that there exist an assignment of $a_i$, such that $\sum_{i=1}^n a_i= S$ is always true.