Project Euler problem 24 - Lexicographic permutations (work in progress)