Fun with factorials

From futility closet, pointing to this entry in the Encyclopedia of Integer Sequences: numbers such that n divides the number of digits of n! are: 1, 22, 23, 24, 266, 267, 268, 2712, 2713, 27175, 27176, 271819, 271820, 271821, 2718272, 2718273, 27182807, 27182808, 271828170, 271828171, 271828172, and so on. (For example, 266! has 266 \times 2 = 532 digits. This supposedly comes from a column of Martin Gardner, “Factorial Oddities”, which I don’t have.

This seems a bit mysterious at first: what’s the decimal expansion of e doing there? But there’s a simple explanation. Recall Stirling’s approximation: n! \approx (n/e)^n. Taking log base 10, we get \log_{10} n! \approx n \log_{10} (n/e). But for n! to have kn digits, we need \log_{10} n! \approx kn. Thus n! will have kn digits around when \log_{10} (n/e) = k. Solving for n gives n \approx e \times 10^k.

This basically all follows from the approximation (n!)^{1/n} \approx (n/e).

But the numbers in that series are actually a bit below a power of 10 times e; recall e = 2.718281828\ldots 1, so if what I’d just done worked exactly we’d have 2718281 in the sequence, But we have 2718272 and 2718273, eight and nine less than that. This is because we could have used the more accurate verison of the approximation: n! \approx \sqrt{2\pi n} (n/e)^n. Thus (n!)^{1/n} \approx n/e is a slight underapproximation.

1. no, e isn’t rational.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s