Adjust permutations formula for problem 15