Formulas for permutations and combinations