OFFSET
0,3
COMMENTS
Start with the identical permutation [0,1,2,...,n-1] and obtain the next permutation by finding the element a(n) (n>=1) and cyclically shifting the prefix ending in a(n) by one position to the right (see right column in example for A191246).
REFERENCES
Aaron Williams, Loopless Generation of Multiset Permutations using a Constant Number of Variables by Prefix Shifts, ACM-SIAM Symposium on Discrete Algorithms (SODA09), (2009), see link.
LINKS
SODA 2009 proceedings with Williams' paper: SIAM: Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms.
EXAMPLE
(see A191246).
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, May 28 2011
STATUS
approved