Sequentially Indexing Permutations: A Linear Algorithm for Computing Lexicographic Rank = 1. Those minor changes aside, there’s not much more that can be done to speed this algorithm up. It’s… Continue Reading code, element, lehmer