ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 04 Apr 2017 10:52:09 +0200permutations with propertyhttps://ask.sagemath.org/question/37155/permutations-with-property/ How can I get a list of permutations $\sigma \in \mathfrak{S}_n$ with the property that $\sigma(i) \geq i-1$ for all $i =1, dots, n.$Mon, 03 Apr 2017 22:41:41 +0200https://ask.sagemath.org/question/37155/permutations-with-property/Answer by FrédéricC for <p>How can I get a list of permutations $\sigma \in \mathfrak{S}_n$ with the property that $\sigma(i) \geq i-1$ for all $i =1, dots, n.$</p>
https://ask.sagemath.org/question/37155/permutations-with-property/?answer=37161#post-id-37161Like that
sage: n=4
sage: [sigma for sigma in Permutations(n) if all(sigma(i)>=i-1 for i in range(1,n+1))]Tue, 04 Apr 2017 10:52:09 +0200https://ask.sagemath.org/question/37155/permutations-with-property/?answer=37161#post-id-37161