> I've tried to think of an efficient and economical (and therefore > clever) way of doing this for larger problems; but that will have > to wait for another day! The ruby permutations library (http://permutation.rubyforge.org/doc/index.html) references The Algorithm Design Manual, Steven S. Skiena, Telos/Springer, 1997, for permutation sequences. Hadley