Find all non-decreasing sequences of k numbers, k>=1, created from n different numbers, with repetitions of numbers allowed.

18 Views Asked by At

Take n different integers, e.g. 4,7,15 (n=3 here). Using the numbers, create non-decreasing sequences of k numbers, k>=1, where repetition is allowed. If k=4, we can have (4,4,7,15). The sequence (4,7,15,7) is not allowed because the sequence is decreasing at one point. There is a connection to a binomial coefficient here from what I can see. In this particular case, there are 15 sequences: (4,4,4,4), (4,4,4,7), (4,4,4,15), (4,4,7,7), (4,4,7,15), (4,4,15,15), (4,7,7,7), (4,7,7,15), (4,7,15,15), (4,15,15,15), (7,7,7,7), (7,7,7,15), (7,7,15,15), (7,15,15,15), (15,15,15,15).