permutation calc