Вычисление и генерация факториалов, перестановок и комбинаций в Python https://ru.from-locals.com/python-math-factorial-permutations-combinations/