I am looking for an effective way to generate a complete list of integer sequences
{a_1,a_2,...,a_n}
of the length $n$ such that $$0\le a_1\le a_2\le\dots\le a_n< m,$$
with two integer parameters $n$ and $m$.
I can imagine to perform this via
Table[Sort[IntegerDigits[x-1,m,n]],{x,m^n}]
and then delete duplicates, but surely there should exist a much more effective way.
With[{m = 10, n = 5}, Subtract[1 + #, Range[n]] & /@ Subsets[Range[m + n - 1], {n}]]? (+1) – kglr Dec 02 '20 at 12:53