d each consecutive permutation can be obtained
from the previous one a by single adjacent transposition.
</p>
<p>See also <code><a href="#perm_005fnext">perm_next</a></code>, <code><a href="#perm_005frank">perm_rank</a></code> and <code><a href="#perm_005funrank">perm_unrank</a></code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) load(&quot;combinatorics&quot;)$
(%i2) perms (4);
(%o2) [[1, 2, 3, 4], [1, 2, 4, 3], [1, 4, 2, 3], [4, 1, 2, 3], 
[4, 1, 3, 2], [1, 4, 3, 2], [1, 3, 4, 2], [1, 3, 2, 4], 
[3,