@Jose_A_Alonso Thank you for referencing that paper! If you'd like a quick look at the #Lisp code, feel free to check out the snippet I uploaded here:
https://git.univ-pau.fr/tbaruchel/numerical-routines/-/snippets/5
The core concept of the algorithm is to iterate in-place over all permutations, efficiently reusing all nodes of the native Lisp list.