A combinatorial way to understand $\sum \log^2 n $

89 Views Asked by At

Stirling's formula has many derivations using the factorial function:

$$ \log N! = \sum_{n=1}^N \log n = \sum_{n=1}^N \sum_{m=1}^n \bigg( \log m - \log (m-1) \bigg) = \sum_{n=1}^N \sum_{m=1}^n - \log \bigg(1 - \frac{1}{m} \bigg) $$

Then we can use the identity $\log (1+x) \approx x$ to obtain a Harmonic series:

$$\sum_{n=1}^N \sum_{m=1}^n - \log \bigg(1 - \frac{1}{m} \bigg) \approx \sum_{n=1}^N \sum_{m=1}^n \frac{1}{m} = \sum_{m=1}^N \frac{N-m}{m} = \sum_{m=1}^N \left( N \cdot \frac{1}{m}- 1 \right)\approx N \log N - N$$


What can we say about the sum of squares of logarithms? Since $\log^2 n$ has no special addition or multiplication rules the combinatoris is harder to decipher.

Both asymptotics can be found quickly using integration by parts or other great calculus tricks. Adding $\log^2 n $ together tends to be appears more in number theory and I wondered also counted something, as $N!$ does.

Here is my contrived derivation:

$$ \sum_{n=1}^N \log^2 n = \sum_{n=1}^N \sum_{m=1}^n \bigg( \log^2 m - \log^2 (m-1) \bigg) $$

The terms in parentheses can be estimated using the mean value theorem:

$$ \log^2 m - \log^2 (m-1) = \log^2 m - \left( \log m - \log (1 - \frac{1}{m})\right)^2 \approx \tfrac{2}{m} \log m$$

Then can insert back into the formula:

$$\sum_{n=1}^N \sum_{m=1}^n\tfrac{1}{m} \log m = \sum_{m=1}^N\frac{N-m}{m} \;\log m = N \underbrace{\sum_{m=1}^N\frac{1}{m} \;\log m}_{} - \sum_{m=1}^N\log m $$

What is the combinatorial meaning of $\prod_{m=1}^N m^{1/m}$ ? Is there any way to put this quantity in analogy with $N! $ ?