(this number and fact were submitted by @hardal201)
This number is equal to 7!, so it's the number of distinct permutations of 7 objects.
It is the second number to be divisible by every positive single-digit number (so the numbers 1 through 9). The only number below 5,040 to share this property is 2,520.
It is also a highly composite number, which essentially means it has lots of divisors. Specifically, it means that it has more divisors than any smaller number.
Furthermore, it is a superior highly composite number, which means that it is highly composite relative to its size (since bigger numbers will have more divisors just by the nature of construction, we look at how many divisors it has relative to its size). In other words, it maximizes the number of divisors after penalizing larger numbers by a fixed power of their size.
5,040 has 60 divisors, which is a lot for a number that size. It's also the last factorial to be a superior highly composite number.
It is also a colossally abundant number, which again means it is unusually divisor-rich, but in a much stronger sense. Specifically, it is defined by a ratio between the sum of an integer's divisors and that integer raised to a power higher than one. For a given exponent ε, whichever integer has the highest ratio is called colossally abundant (for that ε). In the case of 5,040, we know that:
In other words, if σ(n) is defined as the sum of the divisors of n, then whichever number n maximizes:
for some ε is called a colossally abundant number. Numerically, 5,040 maximizes this equation when ε is roughly around 0.23 to 0.26.
Note that this connects really closely with the famous Riemann Hypothesis. Specifically, we know that for all integers n > 5,040, Robin proved that the Riemann Hypothesis is equivalent to
where γ is approximately 0.57721, the Euler-Mascheroni constant.
This inequality fails for some small n, and 5,040 is the largest exception. If the inequality holds for every n > 5,040, then the Riemann Hypothesis is true. If it fails even once above 5,040, then the Riemann Hypothesis is false.
This means that 5,040 is essentially the last safe harbor.
As a final fun fact, it was Plato's favorite number. He mentions in his dialogue Laws that 5,040 is a convenient number to use for dividing many things (including both the citizens and the land of a city-state) into lesser parts, making it an ideal number for the number of citizens (heads of families). He remarked that this number can be divided by all natural numbers from 1 to 12 with the single exception of 11. In addition, 5,038, which is two less, can be divided into 11. He also noticed that 5,040 could be divided by 12 twice over.
Plato mentioned this number so much that Benjamin Jowett, in the introduction to his translation of Laws, wrote:
"Plato, writing under Pythagorean influences, seems really to have supported that the well-being of the city depended almost as much on the number 5,040 as on justice and moderation."