public static BigInteger CalcFactorial(int n) { BigInteger result = 1; for (int i = n; i > 0; i--) { result *= i; } return result; }