Skip to main content

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$$$0 < b_1 = a_1+1 < b_2 = a_2+2 < b_3 =a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n-1]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m+n-1], {n}]
Subtract[#, Range[n]] & /@ list

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n-1]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m+n-1], {n}]
Subtract[#, Range[n]] & /@ list

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b_1 = a_1+1 < b_2 = a_2+2 < b_3 =a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n-1]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m+n-1], {n}]
Subtract[#, Range[n]] & /@ list
added 20 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n]Range[m+n-1]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m]Subsets[Range[m+n-1], {n}]
Subtract[#, Range[n]] & /@ list

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m], {n}]
Subtract[#, Range[n]] & /@ list

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n-1]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m+n-1], {n}]
Subtract[#, Range[n]] & /@ list
added 20 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

list = With[{m = 10, 8;
n = 5}, Subsets[Range[m5;
list += n]Subsets[Range[m], {n}]]]
Subtract[#, Range[n]] & /@ list

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

list = With[{m = 10, n = 5}, Subsets[Range[m + n], {n}]]

Since we can map such sequence

$$0\leq a_1\leq a_2\leq a_3 \leq \cdots \leq a_{n-1}\leq a_n < m $$ to $$0 < b1=a_1+1 < b2=a_2+2 < b3=a_3+3 <\cdots < b_n=a_n+n < m+n $$ and $\{b_1,b_2,\cdots b_n\}$ is the n subsets of Range[m+n]

And we can get $\{a_1,a_2,\cdots a_n\}$ from $\{b_1,b_2,\cdots b_n\}-\{1,2,\cdots,n\}$

m = 8;
n = 5;
list = Subsets[Range[m], {n}]
Subtract[#, Range[n]] & /@ list
deleted 23 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
added 85 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
Post Undeleted by cvgmt
added 292 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
Post Deleted by cvgmt
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading