Factorial of 240
240! = 4067885363647058120493575921486885310172051259182827146069755969081486918925585104009100729728348522923820890245870098659147156051905732563147381599098459244752463027688115705371704628286326621238456543307267608612545168337779669138759451760395968217423617954330737034164596496963986817722252221059768080852489940995605579171999666916004042965293896799800598079985264195119506681577622056215044851618236292136960000000000000000000000000000000000000000000000000000000000
469 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
240! = 240 × 239 × … × 2 × 1 = 4067885363647058120493575921486885310172…
Facts about 240!
| Digits | 469 |
|---|---|
| Trailing zeros | 58 (one for every factor 5 × 2) |
| Stirling estimate | ≈ Infinity |
| 240! ÷ 239! | 240 |
Nearby factorials
| 238! | 709185035503322545413803… (464 digits) |
| 239! | 169495223485294088353898… (467 digits) |
| 241! | 980360372638941007038951… (471 digits) |
| 242! | 237247210178623723703426… (474 digits) |
What are factorials used for?
Counting arrangements: 240! is the number of different orders in which 240 distinct items can be lined up. Factorials also appear in probability, combinations and series.
Counting with 240!
There are 4.0678 × 10^468 different ways to arrange 240 different books on a shelf: 240 choices for the first place, 239 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 240 runners, there are 240 × 239 × 238 = 13,651,680 possible podiums. If the order does not matter, divide by 3! = 6 to get 2,275,280 ways to choose a group of three. Choosing a pair from 240 people can be done in 28,680 ways.
In probability, if 240 names are drawn out of a hat one at a time, the chance of drawing them in one particular order is 1 in 4.0678 × 10^468. That is why shuffled decks and passwords with many symbols are so hard to guess.
How big is 240!?
240! has 469 digits, so it is larger than the estimated number of atoms in the observable universe (about 10^80). The digits add up to 1926, 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 240!
Every prime up to 240 divides 240!. Legendre's formula counts how often: add ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … for each prime p. For 240! that gives 2^236 × 3^116 × 5^58 × 7^38 × 11^22 × 13^19 × 17^14 × 19^12 × 23^10 × 29^8 × … (52 primes in all). The 58 trailing zeros come from pairing the 58 factors of 5 with factors of 2.
Shuffles where nothing stays put
A related count is the number of derangements of 240 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 240! ÷ e, so about 36.8% of all 4.0678 × 10^468 orders are derangements. From about four items on, that share stays close to 1 ÷ e, roughly 37%, however many items there are.
Computing 240! yourself
In Excel or Google Sheets, type =FACT(240). 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(240) returns the exact integer with all 469 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 240 factorial?
240! is the product of every whole number from 1 to 240.
How many digits does 240! have?
469. The number of digits of n! is the whole part of log10(n!) plus one.
How many zeros are at the end of 240!?
58. Count the factors of 5 in the numbers 1 to 240: there are always more factors of 2, so every 5 makes one trailing zero.
Is 240! divisible by 241?
No. 241 is prime and bigger than every factor of 240!, so it cannot divide it (Wilson's theorem says 240! leaves a remainder of 240 when divided by 241).
What is the last non-zero digit of 240!?
6. Strip the 58 trailing zeros and look at the digit that is left at the end.
What is 241! in terms of 240!?
241! = 241 × 240!. Each factorial is the previous one multiplied by the next whole number.