Sumwise

Factorial of 395

395! = 6412280706583424106224159312516580473049635787024220537160755807201268848956708645091970190015648630248538560354885269182750769131851738630064402449110408653221929059920462838358401757946980339334596257811409430070645603490878194943154311781988269272955314076415550908252633112675082775952389051056363700317488901391022385317358482407310777354081436195370810221335572782804365810541632803751254217179014316721939881906180759266655257897035667086440901654022673872856106889508880656182150021209179017734064383373487873660144624545258263727458417470467055284850529796599471285277278355108789021200859677481591100314542365210070169879736048889793518640217009045210565268181290125372414304500560198083128488681894238690662637443786479418784777198734444193099284480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

856 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

395! = 395 × 394 × … × 2 × 1 = 6412280706583424106224159312516580473049…

Facts about 395!

Digits856
Trailing zeros97 (one for every factor 5 × 2)
Stirling estimate≈ Infinity
395! ÷ 394!395

Nearby factorials

393!412020864009729750448124… (851 digits)
394!162336220419833521676560… (854 digits)
396!253926315980703594606476… (859 digits)
397!100808747444339327058771… (862 digits)

What are factorials used for?

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

Counting with 395!

There are 6.4122 × 10^855 different ways to arrange 395 different books on a shelf: 395 choices for the first place, 394 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 395 runners, there are 395 × 394 × 393 = 61,162,590 possible podiums. If the order does not matter, divide by 3! = 6 to get 10,193,765 ways to choose a group of three. Choosing a pair from 395 people can be done in 77,815 ways.

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

How big is 395!?

395! has 856 digits, so it is larger than the estimated number of atoms in the observable universe (about 10^80). The digits add up to 3312, 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 395!

Every prime up to 395 divides 395!. Legendre's formula counts how often: add ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … for each prime p. For 395! that gives 2^390 × 3^193 × 5^97 × 7^65 × 11^38 × 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 395 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 395! ÷ e, so about 36.8% of all 6.4122 × 10^855 orders are derangements. From about four items on, that share stays close to 1 ÷ e, roughly 37%, however many items there are.

Computing 395! yourself

In Excel or Google Sheets, type =FACT(395). 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(395) returns the exact integer with all 856 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 395 factorial?

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

How many digits does 395! have?

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

How many zeros are at the end of 395!?

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

Is 395! divisible by 396?

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

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

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

What is 396! in terms of 395!?

396! = 396 × 395!. Each factorial is the previous one multiplied by the next whole number.