Factorials: Growth of n!

April 13, 2026

Problem

Compute 7! = 5040. Show the chain 7 × 6 × 5 × 4 × 3 × 2 × 1 with a growing bar, and visualize why factorial grows faster than exponential.

Explanation

What is a factorial?

For a non-negative integer nn, the factorial is n!=n(n1)(n2)21n! = n \cdot (n - 1) \cdot (n - 2) \cdots 2 \cdot 1

with the convention 0!=10! = 1 (the empty product).

Combinatorially, n!n! counts the number of ways to arrange nn distinct objects in a sequence — the number of permutations of nn items.

Step-by-step: compute 7!

We multiply in sequence, showing the running product at each step.

Step 1: 76=427 \cdot 6 = 42 Step 2: 425=21042 \cdot 5 = 210 Step 3: 2104=840210 \cdot 4 = 840 Step 4: 8403=2520840 \cdot 3 = 2520 Step 5: 25202=50402520 \cdot 2 = 5040 Step 6: 50401=50405040 \cdot 1 = 5040

7!=5040\boxed{7! = 5040}

How fast does n!n! grow?

Factorial grows super-exponentially — faster than any fixed ana^n for constant aa.

  • 1!=11! = 1
  • 2!=22! = 2
  • 3!=63! = 6
  • 4!=244! = 24
  • 5!=1205! = 120
  • 6!=7206! = 720
  • 7!=5,0407! = 5{,}040
  • 8!=40,3208! = 40{,}320
  • 9!=362,8809! = 362{,}880
  • 10!=3,628,80010! = 3{,}628{,}800

Each step multiplies by a larger number, so the growth accelerates. By n=20n = 20, n!n! is already above 2×10182 \times 10^{18}.

Stirling's approximation

For large nn, a very accurate estimate is n!2πn(ne)nn! \approx \sqrt{2 \pi n} \, \left(\dfrac{n}{e}\right)^n

It turns the factorial into something comparable with exponentials. For n=7n = 7, Stirling gives 4980\approx 4980, within 1.2% of the true 50405040.

Where factorials appear

  • Permutations: P(n,r)=n!/(nr)!P(n, r) = n!/(n-r)!.
  • Combinations: C(n,r)=n!/(r!(nr)!)C(n, r) = n! / (r!(n-r)!).
  • Taylor series: ex=k=0xk/k!e^x = \sum_{k=0}^{\infty} x^k / k!.
  • Probability distributions: Poisson's λkeλ/k!\lambda^k e^{-\lambda}/k!, binomial's (nk)\binom{n}{k}.

Common mistakes

  • Claiming 0!=00! = 0. The convention is 0!=10! = 1; the empty product is 1, and it makes formulas like (n0)=1\binom{n}{0} = 1 work.
  • Computing n!n! by addition. Factorial is a product, not a sum. 5!5! is 120120, not 1+2+3+4+5=151+2+3+4+5 = 15.
  • Overflow. n!n! explodes fast; 20!20! already exceeds a 64-bit integer when multiplied by much more. Use arbitrary-precision arithmetic or logarithms for large nn.

Try it in the visualization

Adjust the nn slider and watch the product assemble step by step, with a bar graph scaling up (sometimes logarithmically, with the toggle on) to visualize the superlinear climb.

Interactive Visualization

Parameters

7.00
0.00
4.00
Cyan
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Factorials: Growth of n! | MathSpin