Sumwise

Factorial of 401

401! = 25677843661496182000201536098120705346131735793427186742932462823063761264843919405947669937632769135194034580589378581150167563316290491526813757447368002172874003314486103133011238883275125543974331060893917027155772339882165050114354572724529418209461481285149296399395529834905598835719694439567902779033893749255270049840866482945120105297223119367080161773889051272503394031055339749926338097715765256193148745110636811071194127894147824604213626196670810983752199333135922447325207906649317384097272522026195865012893161521091998770759607457611726029278709849134407169168276138864006470137440254864143541640526605930274559644767095442736918010399294008679446661742025138153178740223002652083011164429306226908181727093035924621223618383677657011688360160118028894208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

872 digits

Sumwise · Maintained by Theo Abbott (pen name) · automated checks · Data: exact arithmetic; unit definitions from NIST SP 811 · Updated · How the checks work

How it is calculated

401! = 401 × 400 × … × 2 × 1 = 2567784366149618200020153609812070534613…

Facts about 401!

Digits872
Trailing zeros99 (one for every factor 5 × 2)
Stirling estimate≈ Infinity
401! ÷ 400!401

Nearby factorials

399!160086307116559738155869… (867 digits)
400!640345228466238952623479… (869 digits)
402!103224931519214651640810… (875 digits)
403!415996474022435046112465… (877 digits)

What are factorials used for?

Counting arrangements: 401! is the number of different orders in which 401 distinct items can be lined up. Factorials also appear in probability, combinations and series.

Counting with 401!

There are 2.5677 × 10^871 different ways to arrange 401 different books on a shelf: 401 choices for the first place, 400 for the second, and so on down to one choice for the last. If you only fill the first three places, as with gold, silver and bronze among 401 runners, there are 401 × 400 × 399 = 63,999,600 possible podiums. If the order does not matter, divide by 3! = 6 to get 10,666,600 ways to choose a group of three. Choosing a pair from 401 people can be done in 80,200 ways.

In probability, if 401 names are drawn out of a hat one at a time, the chance of drawing them in one particular order is 1 in 2.5677 × 10^871. That is why shuffled decks and passwords with many symbols are so hard to guess.

How big is 401!?

401! has 872 digits, so it is larger than the estimated number of atoms in the observable universe (about 10^80). The digits add up to 3339, a multiple of 9, as they are for every factorial from 6! on. Stirling's formula, √(2πn) × (n/e)^n, gives a close estimate without multiplying everything out, and gets more accurate as n grows.

Prime factors of 401!

Every prime up to 401 divides 401!. Legendre's formula counts how often: add ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … for each prime p. For 401! that gives 2^397 × 3^196 × 5^99 × 7^66 × 11^39 × 13^32 × 17^24 × 19^22 × 23^17 × 29^13 × … (79 primes in all). The 99 trailing zeros come from pairing the 99 factors of 5 with factors of 2.

Shuffles where nothing stays put

A related count is the number of derangements of 401 items: orders in which no item ends up in its original place, as in a Secret Santa where nobody draws their own name. The count is the whole number nearest to 401! ÷ e, so about 36.8% of all 2.5677 × 10^871 orders are derangements. From about four items on, that share stays close to 1 ÷ e, roughly 37%, however many items there are.

Computing 401! yourself

In Excel or Google Sheets, type =FACT(401). Spreadsheets keep only 15 significant digits, so from 18! on the result is rounded, and FACT stops at 170!, the largest factorial that fits in a standard floating-point number. In Python, math.factorial(401) returns the exact integer with all 872 digits, because Python integers have no size limit. The gamma function extends factorials to fractions: Γ(n + 1) = n!, so (1/2)! = √π ÷ 2 ≈ 0.8862.

Why is 0! equal to 1?

There is exactly one way to arrange nothing, and the rule n! = n × (n − 1)! only works for n = 1 if 0! = 1. Defining it this way keeps formulas for combinations and series correct at the edges.

Calculate another factorial

How answers are calculated and checked: methodology.

Questions

What is 401 factorial?

401! is the product of every whole number from 1 to 401.

How many digits does 401! have?

872. The number of digits of n! is the whole part of log10(n!) plus one.

How many zeros are at the end of 401!?

99. Count the factors of 5 in the numbers 1 to 401: there are always more factors of 2, so every 5 makes one trailing zero.

Is 401! divisible by 402?

Yes. 402 is not prime, so its factors already appear among the numbers 1 to 401.

What is the last non-zero digit of 401!?

8. Strip the 99 trailing zeros and look at the digit that is left at the end.

What is 402! in terms of 401!?

402! = 402 × 401!. Each factorial is the previous one multiplied by the next whole number.