: I am having a big math problem and would really appreciate some help.
i want to generate all the combinations where
n = 20 ie. 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 and
r = 5
1)i known the amount of different combinations it have 15504, but i want to generate the sets of numbers.
eg. 1,3,5,7,9 -- this is a set because it has 5 numbers
2,7,10,19,20 -- this is also correct.
2) in a given set like the ones above a digit can only be used once in a set.
eg 2,5,7,2,19 this is wrong because the number 2 is repeated.