Factorial of 396
396! = 2539263159807035946064767087756565867327655771661591332715659299651702464186856623456420195246196857578421269900534566596369304576213288497505503369847721826675883907728503283989927096147004214376500118093318134307975658982387765197489107465667354632090304374260558159668042712619332779277146064218320025325725604950844864585673959033295067832216248733366840847648886821990528860974486590285496670002889669421888193234847580669595482127226124166230597054992978853651018328245516739848131408398834891022689495815901197969417271319922272436073533318304953892800809799453390628969802228623080452395540432282710075724558776623187787272375475360358233381525935581903383846199790889647476064582221838440918881518030118521502404427739445849838771770698839900467316654080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
859 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
396! = 396 × 395 × … × 2 × 1 = 2539263159807035946064767087756565867327…
Facts about 396!
| Digits | 859 |
|---|---|
| Trailing zeros | 97 (one for every factor 5 × 2) |
| Stirling estimate | ≈ Infinity |
| 396! ÷ 395! | 396 |
Nearby factorials
| 394! | 162336220419833521676560… (854 digits) |
| 395! | 641228070658342410622415… (856 digits) |
| 397! | 100808747444339327058771… (862 digits) |
| 398! | 401218814828470521693909… (864 digits) |
What are factorials used for?
Counting arrangements: 396! is the number of different orders in which 396 distinct items can be lined up. Factorials also appear in probability, combinations and series.
Counting with 396!
There are 2.5392 × 10^858 different ways to arrange 396 different books on a shelf: 396 choices for the first place, 395 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 396 runners, there are 396 × 395 × 394 = 61,629,480 possible podiums. If the order does not matter, divide by 3! = 6 to get 10,271,580 ways to choose a group of three. Choosing a pair from 396 people can be done in 78,210 ways.
In probability, if 396 names are drawn out of a hat one at a time, the chance of drawing them in one particular order is 1 in 2.5392 × 10^858. That is why shuffled decks and passwords with many symbols are so hard to guess.
How big is 396!?
396! has 859 digits, so it is larger than the estimated number of atoms in the observable universe (about 10^80). The digits add up to 3582, 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 396!
Every prime up to 396 divides 396!. Legendre's formula counts how often: add ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … for each prime p. For 396! that gives 2^392 × 3^195 × 5^97 × 7^65 × 11^39 × 13^32 × 17^24 × 19^21 × 23^17 × 29^13 × … (77 primes in all). The 97 trailing zeros come from pairing the 97 factors of 5 with factors of 2.
Shuffles where nothing stays put
A related count is the number of derangements of 396 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 396! ÷ e, so about 36.8% of all 2.5392 × 10^858 orders are derangements. From about four items on, that share stays close to 1 ÷ e, roughly 37%, however many items there are.
Computing 396! yourself
In Excel or Google Sheets, type =FACT(396). 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(396) returns the exact integer with all 859 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.
How answers are calculated and checked: methodology.
Questions
What is 396 factorial?
396! is the product of every whole number from 1 to 396.
How many digits does 396! have?
859. The number of digits of n! is the whole part of log10(n!) plus one.
How many zeros are at the end of 396!?
97. Count the factors of 5 in the numbers 1 to 396: there are always more factors of 2, so every 5 makes one trailing zero.
Is 396! divisible by 397?
No. 397 is prime and bigger than every factor of 396!, so it cannot divide it (Wilson's theorem says 396! leaves a remainder of 396 when divided by 397).
What is the last non-zero digit of 396!?
8. Strip the 97 trailing zeros and look at the digit that is left at the end.
What is 397! in terms of 396!?
397! = 397 × 396!. Each factorial is the previous one multiplied by the next whole number.