def calculate_factorial_multi2(number):
    prime = [True] * (number + 1)
result = 1
factor2 = 0
factor5 = 0
for i in range(2, number + 1):
    if prime[i]:
        j = i + i
while j <= number:
    prime[j] = False
j += i
sum = 0
t = i
while t <= number:
    sum += number / t
t *= i
if i == 2:
    factor2 = sum
elif i == 5:
    factor5 = sum
else:
    result *= i ** sum
return (result << factor2 - factor5) * 10 ** factor5
Эффективно вычислять факториал без конечных нулей?