I'm looking to generate a list of all combinations of n numbers when choosing y of them. Each letter can repeat and order doesn't matter.
There's plenty of code to do simple permutations or combinations but nothing I could adept to fit this situation.

For instance if n = 3 and y = 2, the list should be:
1,1
1,2
1,3
2,2
2,3
3,3

and if n= 3 and y = 3
1,1,1
1,1,2
1,1,3
1,2,2
1,2,3
1,3,3
2,2,2
2,2,3
2,3,3
3,3,3

Any ideas?
TIA