Let $k>0$ and $(l_1,\ldots,l_n)$ be given with $l_i>0$ (and the l_i's need not be distinct). How do I count the number of distinct tuples $(a_1,\ldots,a_r)$ where $a_1+\ldots+a_r=k$ and each $a_i$ is some $l_j$. There will typically be a different length $r$ for each such tuple.
If there is not a reasonably simple expression, is there some known asymptotic behavior as a function of $k$?