Question: Generating a Random Permutation in Maple 15

I want to write a procedure P such that the input of P is a positive integer number n and the output of P is a random permutation of the numbers {1,2,..,n}. 

I know that there is a command in Maple 2017 such that the command produces the mentioned request (random permutation in the combinatoric package), but I should work with Maple 15 and there is no the random permutation command in Maple 15. 

One of the solutions that I am used is based on the random number and check that if the produced numbers are pairwise distinct or not. The problem of this method  is that for n>128, it takes too time to generate a random permutation of the length n.

Thanks for any suggestions. 

Please Wait...