How to Use the Calculator
Enter a non-negative integer and select the type:
- n! — Standard factorial: 5! = 5×4×3×2×1 = 120
- n!! — Double factorial: 5!! = 5×3×1 = 15 (product of same-parity numbers)
- !n — Subfactorial/derangements: !5 = 44 (permutations with no fixed points)
How Fast Factorials Grow
Factorial growth is faster than exponential:
- 5! = 120 (3 digits)
- 10! = 3,628,800 (7 digits)
- 20! = 2.43 × 10¹⁸ (19 digits)
- 100! = 9.33 × 10¹⁵⁷ (158 digits)
- 1000! has 2,568 digits
- 10000! has 35,660 digits
Stirling's approximation: n! ≈ √(2πn) × (n/e)ⁿ gives accurate estimates for large n.
Trailing Zeros in Factorials
The number of trailing zeros in n! equals the number of times 10 divides n!, which is determined by the number of factor-5 pairs:
Trailing zeros = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + ⌊n/625⌋ + ...
For example, 100! has ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 trailing zeros.
Step-by-Step Instructions
- 1Enter a non-negative integer (0 to 10,000).
- 2Select the mode: standard factorial, double factorial, or subfactorial.
- 3View the exact result (uses BigInt for precision).
- 4See the step-by-step expansion showing the multiplication chain.
- 5Check the digit count and trailing zeros analysis.