Sumwise

Factorial of 366

366! = 9188111095254496019212176412065202140090580418774645194675369840967804846588863095597762591294093025991679067056119532289819154031153412626361004655299317292397491794124983183190181485863175356339673174577270709354011349841159870162315388021077551574544150339454677263259292741490470278652918758618155319193382176540756099231912808304474174078456156193961001478398647954868692612278257154615836148475874973044173323055630082048837853679900542059105112845394071947192443208478530700194532818459855315620661704950466695965700997551748520475941227743698121112130799760005290512978278155471280205501581277410145813062661991385483143379923345195406432165518340351716868931650203126650444315203993600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

781 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

366! = 366 × 365 × … × 2 × 1 = 9188111095254496019212176412065202140090…

Facts about 366!

Digits781
Trailing zeros89 (one for every factor 5 × 2)
Stirling estimate≈ Infinity
366! ÷ 365!366

Nearby factorials

364!687784347275581706655601… (776 digits)
365!251041286755587322929294… (779 digits)
367!337203677195840003905086… (784 digits)
368!124090953208069121437071… (787 digits)

What are factorials used for?

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

Counting with 366!

There are 9.1881 × 10^780 different ways to arrange 366 different books on a shelf: 366 choices for the first place, 365 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 366 runners, there are 366 × 365 × 364 = 48,626,760 possible podiums. If the order does not matter, divide by 3! = 6 to get 8,104,460 ways to choose a group of three. Choosing a pair from 366 people can be done in 66,795 ways.

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

How big is 366!?

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

Every prime up to 366 divides 366!. Legendre's formula counts how often: add ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … for each prime p. For 366! that gives 2^360 × 3^180 × 5^89 × 7^60 × 11^36 × 13^30 × 17^22 × 19^20 × 23^15 × 29^12 × … (72 primes in all). The 89 trailing zeros come from pairing the 89 factors of 5 with factors of 2.

Shuffles where nothing stays put

A related count is the number of derangements of 366 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 366! ÷ e, so about 36.8% of all 9.1881 × 10^780 orders are derangements. From about four items on, that share stays close to 1 ÷ e, roughly 37%, however many items there are.

Computing 366! yourself

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

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

How many digits does 366! have?

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

How many zeros are at the end of 366!?

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

Is 366! divisible by 367?

No. 367 is prime and bigger than every factor of 366!, so it cannot divide it (Wilson's theorem says 366! leaves a remainder of 366 when divided by 367).

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

6. Strip the 89 trailing zeros and look at the digit that is left at the end.

What is 367! in terms of 366!?

367! = 367 × 366!. Each factorial is the previous one multiplied by the next whole number.