Consider the following sum, where $\operatorname{li}((x)$ is the logarithmic integral function:
$$\operatorname{lisum}(x) = \sum_{k=1} ^{\lfloor\sqrt x\rfloor} \operatorname{li}((x/k)$$
For small $x$, $\operatorname{lisum}(x)>x$, but at about $x=\exp(\exp(2))$ and above, $\operatorname{lisum}(x)< x$.
The curious thing about this sum is the difference $\log(\log(x)) - \log(\log(\operatorname{lisum}(x)))$. Of course it becomes positive when $x>\operatorname{lisum}(x)$, but the behavior beyond that point is interesting. It reaches a small positive maximum but then decreases again, and the behavior as $x\rightarrow\infty$ is not clear to me.
As far as I can determine, the positive maximum of this difference occurs at $x=4028048.999\ldots$, just less than $2007^2$, where $\log(\log(x)) - \log(\log(\operatorname{lisum}(x))) = 0.0131248248\ldots$.
Curiously, at this value $\log(\log(x))=2.72187372\ldots$, $\log(\log(\operatorname{lisum}(x)))=2.708748902\ldots$, and $\exp(\exp(0.0131248248\ldots))=2.754432227\ldots$. All of these values are beguilingly close to $e$, but I cannot find a direct relationship to $e$ or a reason why the maximum occurs here.
Question 1: Why does this maximum occur so close to $e$ but not precisely at $e$?
Question 2: How does $\log(\log(x)) - \log(\log(\operatorname{lisum}(x)))$ behave as $x\rightarrow\infty$?
Up to about $x=\exp(\exp(3.4))$, the rate of growth of $\log(\log(\operatorname{lisum}(x)))$ accelerates, but then it begins to decelerate. (For example, $\log(\log(\operatorname{lisum}(\exp(\exp(3.4)))))-\log(\log(\operatorname{lisum}(\exp(\exp(3.3)))))=0.10069\ldots$, but $\log(\log(\operatorname{lisum}(\exp(\exp(3.5)))))-\log(\log(\operatorname{lisum}(\exp(\exp(3.4)))))=0.10068\ldots$.) It is not clear to me how $\log(\log(x)) - \log(\log(\operatorname{lisum}(x)))$ behaves beyond this point.