Formula for permutations and combinations