permutations with property
How can I get a list of permutations σ∈Sn with the property that σ(i)≥i−1 for all i=1,dots,n.
How can I get a list of permutations σ∈Sn with the property that σ(i)≥i−1 for all i=1,dots,n.
Like that
sage: n=4
sage: [sigma for sigma in Permutations(n) if all(sigma(i)>=i-1 for i in range(1,n+1))]
Asked: 8 years ago
Seen: 1,110 times
Last updated: Apr 04 '17