Loopless multiset permutations generator in constant time/space (from a paper by Aaron Williams).