Work in progress.
In an earlier question about permutations I found a way which didn't
require me to bruteforce it. This time I will have to.