([4, 6, 3, 1, 7, 5, 2, 8]);
(%o2)                           12
</pre>
<div class=categorybox>

<p>Categories:&nbsp;&nbsp;<a href="maxima_107.html#Category_003a-Package-combinatorics">Package combinatorics</a>
</div>
</p>
</dd></dl>

<p><a name="perm_005flex_005fnext"></a>
<a name="Item_003a-perm_005flex_005fnext"></a>
</p><dl>
<dt><u>Function:</u> <b>perm_lex_next</b><i> (<var>p</var>)</i>
<a name="IDX1474"></a>
</dt>
<dd><p>Returns the permutation that comes after the given permutation <var>p</var>,
in the