Below is an approach I've been exploring for connecting the prime counting function with the logarithmic integral and expressing the error term between the two. I find it beguiling, but I've largely run out of ideas for further developing this approach.


Hence this question. What I'd really, really appreciate is either 1) references to papers or research covering the general space of ideas I'm exploring here, 2) an explanation for why this approach is going to be a dead end, or especially 3) ideas for manipulating or further exploring my equation (4) below that I might have overlooked. [Edit]I'm specifically interested in techniques I might be unfamiliar with from the study of the divisor summatory function $D\_k$, which is at the heart of (4). [End Edit] 


**Preliminary**


Start by summing [Linnik's identity](http://books.google.com/books?id=8i7wpzjSWrIC&pg=PA342&lpg=PA342) from 2 to n.


$\displaystyle\sum\_{j=2}^n 1 - \frac{1}{2}\sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor} 1 + \frac{1}{3}\sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}\sum\_{l=2}^{\lfloor\frac{n}{j k}\rfloor} 1 - \frac{1}{4}...=$
$\pi(n) + {\frac{1}{2}}\pi(n^{\frac{1}{2}}) + {\frac{1}{3}}\pi(n^\frac{1}{3})+...$  

(1)


where $\pi(n)$ is the prime counting function. The nested sums on the left only need to be computed up to a depth of $\log\_2 n$ before they start equalling 0.


Next, approximate the left hand side by replacing sums with integrals, starting integration at 1 rather than 2, and removing floor functions from upper bounds. This immediately gives the logarithmic integral.


$\displaystyle\int\_{1}^n dx - \frac{1}{2}\int\_{1}^n \int\_{1}^{\frac{n}{x}} dy dx + \frac{1}{3}\int\_{1}^n \int\_{1}^{\frac{n}{j}}\int\_{1}^{\frac{n}{x y}} dz dy dx - \frac{1}{4}... = li(n) - \log\log n - \gamma$  

(2)


where $li(n)$ is the logarithmic integral and $\gamma$ is the Euler-Mascheroni constant. (You can find a fairly straightforward sketch of the derivations of both (1) and (2) [here](http://www.icecreambreakfast.com/primecount/ApproximingThePrimeCountingFunctionWithLinniksIdentity_NathanMcKenzie.pdf))


Now, Riemann's explicit formula for the prime counting function, with a touch of term rearrangement and with $\rho$ the Zeta Zeroes, is of course


$li(n) - \pi(n) - {\frac{1}{2}}\pi(n^{\frac{1}{2}}) - {\frac{1}{3}}\pi(n^\frac{1}{3})-...=\displaystyle\sum\_{\rho} li(n^\rho) + \log 2 - \int\_x^{\infty}\frac{dt}{t(t^2-1)\log t}$  

(3)


**Question**


Define the following $O( \log \log n)$ function


$E(n) = \log 2 - \int\_n^{\infty}\frac{dt}{t(t^2-1)\log t} + \log \log n + \gamma$


Then, applying both (1) and (2) to (3) gives


$\displaystyle \sum\_{\rho} li(n^\rho) + E(n) =$


$\displaystyle - \frac{1}{2}(\int\_{1}^n \int\_{1}^{\frac{n}{x}} dy dx - \sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor} 1 )$  

$\displaystyle+ \frac{1}{3}(\int\_{1}^n \int\_{1}^{\frac{n}{j}}\int\_{1}^{\frac{n}{x y}} dz dy dx - \sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}\sum\_{l=2}^{\lfloor\frac{n}{j k}\rfloor} 1)$  

$\displaystyle- \frac{1}{4}(\int\_{1}^n \int\_{1}^{\frac{n}{j}}\int\_{1}^{\frac{n}{x y}}\int\_{1}^{\frac{n}{x y z }} dw dz dy dx - \sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}\sum\_{l=2}^{\lfloor\frac{n}{j k}\rfloor}\sum\_{m=2}^{\lfloor\frac{n}{j k l}\rfloor} 1)$  

$\displaystyle +\frac{1}{5}...$  

(4)


*So here is, really, my main question*: can anything interesting be done with the right hand side of (4)? I've largely hit a dead-end here. 


[Edit]
What I'm looking for especially is any smart ideas about different ways of working with, or breaking up, or transforming those various nested sums, particular in ways that might take advantage of symmetries or connections between them.


As Eric Naslund mentions in his equation (2) below, these nested sums are closely related to, and can be expressed in terms of, the divisor summatory function. As a consequence, this opens up the door to the possibility of applying Voronoi summation or the Dirichlet Hyperbola method in connection with these nested sums, for example. I'm curious if there are any other smart techniques from the study of the divisor summatory function that might be brought to bear on (4).
[End Edit]


**Extra**


I have explored, a bit, one approach with (4), to inconclusive results.


The following are all equal


$\displaystyle\sum\_{j=2}^n \sum\_{k=2}^{\lfloor \frac{n}{j} \rfloor} 1 = \sum\_{j=2}^n \lfloor \frac{n}{j} \rfloor - 1 = \sum\_{j=2}^n \frac{n}{j} - 1 - \sum\_{j=2}^n ${$\frac{n}{j}$}


where {n} is the fractional part function. This approach can be generalized to arbitrary depths of nested sums. $\sum\_{j=2}^n \frac{n}{j} - 1$ and its generalization appear to be relatively smooth curves, capable of relatively tight approximation, or that's my hunch based on empirical results. Anyway, relying on this, (4) can be rewritten as


$\displaystyle \sum\_{\rho} li(n^\rho) + E(n) =$


$\displaystyle - \frac{1}{2}(\int\_{1}^n \int\_{1}^{\frac{n}{x}} dy dx - (\sum\_{j=2}^n \frac{n}{j} - 1) + \sum\_{j=2}^n ${$\frac{n}{j}$})  

$\displaystyle+ \frac{1}{3}(\int\_{1}^n \int\_{1}^{\frac{n}{j}}\int\_{1}^{\frac{n}{x y}} dz dy dx - (\sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}\frac{n}{j k} - 1) + \sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}${$\frac{n}{j k}$})  

$\displaystyle- \frac{1}{4}(\int\_{1}^n \int\_{1}^{\frac{n}{j}}\int\_{1}^{\frac{n}{x y}}\int\_{1}^{\frac{n}{x y z }} dw dz dy dx - (\sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}\sum\_{l=2}^{\lfloor\frac{n}{j k}\rfloor}\frac{n}{jkl}-1) + \sum\_{j=2}^n \sum\_{k=2}^{\lfloor\frac{n}{j}\rfloor}\sum\_{l=2}^{\lfloor\frac{n}{j k}\rfloor}${$ \frac{n}{jkl} $})  

$ \displaystyle +\frac{1}{5}...$  

(5).


If you sum up just the terms that look like $\sum\_{j=2}^n \frac{n}{j} - 1$, you get a smooth curve that bears a strong resemblance to the Logarithmic Integral - you can see part of it [here](http://www.icecreambreakfast.com/primecount/primecounting_html_m24e11e4b.jpg). I'm very curious how to approximate these terms, and what relationship they bear to the logarithmic integral. So that's another question of mine.


Finally, if you sum up just the fractional part sums in (5), you get [this function](http://www.icecreambreakfast.com/primecount/primecounting_html_2653f64d.jpg). At least empirically, it appears that all the discontinuities of $\sum\_\rho li(n^\rho)$ are confined to just these terms. All of which leads to my final question - are there any interesting tools or approaches that can be applied to these fractional part sums to make any interesting observations?


I hope this question isn't too vague or broad for MO.



Logarithmic Integral of n^Zeta Zeroes and certain nested sums of the fractional part function
Your above identity stems from $$\text{li(x)}-\Pi(x)+\text{small}=\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty} \log \left((s-1)\zeta(s)\right)\frac{x^s}{s}ds,$$ and a Taylor expansion of the logarithm. What follows is not an exact answer to your question, it is not clear what can or cannot be done with a particular identity. Instead, we give an alternate derivation which lives more in the realm of Dirichlet series and contour integrals, but I think it will shed some light upon the problem. The identity you gave above is essentially an expansion of the logarithm in the classical identity above. 


**Notation:** Let $\Pi(x)=\sum\_{n\leq x}\frac{\Lambda(n)}{\log n}$ denote Riemann's Pi function, that is $$\Pi(x)=\pi(n)+\frac{1}{2}\pi\left(n^{\frac{1}{2}}\right)+\frac{1}{3}\pi\left(n^{\frac{1}{3}}\right)+\cdots,$$ and define $$H\_{k}(x):=\sum\_{j\_{1}=2}^{x}\sum\_{j\_{2}=2}^{\lfloor\frac{x}{j\_{1}}\rfloor}\cdots\sum\_{j\_{k}=2}^{\lfloor\frac{x}{j\_{1}\cdots j\_{k-1}}\rfloor}1$$ to be the number of integer points under hyperbola with entries greater than $2$, and let $$I\_{k}(x)=\int\_{1}^{x}\int\_{1}^{\frac{x}{y\_{1}}}\cdots\int\_{1}^{\frac{x}{y\_{1}\cdots y\_{k-1}}}1\text{d}y\_{1}\cdots\text{d}y\_{k}$$ be the same area when integrated. 


Lets begin by looking at the generalized divisor problem. Using Perrons formula, for any $a>1$ we have that $$D\_{k}(x)=\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}\zeta(s)^{k}\frac{x^{s}}{s}ds,\ \ \ \ \ \ \ \ \ \ (1)$$ where $D\_{k}(x)$ is the sum of the generalized divisor function. $D\_{k}(n)$ is exactly the number of integer points under the $k$-dimensional hyperbola $x\_{1}\cdots x\_{k}=n,$ but our sums start at $2$ instead of $1$ so we need to modify things slightly. To get the sum of the integer points whose smallest entry is larger than $2,$ we have to subtract away the $k$ different $(k-1)$-dimensional hyperbolas, and look at $D\_{k}(n)-kD\_{k-1}(n).$ However this overcompensates, and we have to add back in the $\binom{k}{2}$ different $(k-2)$-dimensional hyperbolas. Continuing in this way, we see that 


$$\sum\_{j=0}^{k}\binom{k}{j}(-1)^{j}D\_{k-j}(n)=H\_{k}(n) \ \ \ \ \ \ \ \ \ \ (2)$$


and hence equation (1) and (2) together imply that $$H\_{k}(x)=\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}\left(\zeta(s)-1\right)^{k}\frac{x^{s}}{s}ds. \ \ \ \ \ \ \ \ \ \ (3)$$


Similarly, in your note you proved that $$I\_k(x)=x\sum\_{j=1}^{k}\frac{\left(\log x\right)^{k-j}}{(k-j)!}(-1)^{j},$$ and noticing the similarities in expansions, we may rewrite this as $$I\_k(x)=\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty} \frac{x^s}{s} \frac{1}{(s-1)^k}ds.\ \ \ \ \ \ \ \ \ \(4)$$


Using (3) and (4), it follows the individual terms are $$\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty} \frac{x^s}{s} \left((\zeta(s)-1)^k-\frac{1}{(s-1)^k}\right)ds.$$ Summing over $k$, and using absolute convergence to switch orders, we have that $$\sum\_{k=1}^\infty \frac{(-1)^k}{k}\left(H\_k(x)-I\_k(x)\right)=\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}\sum\_{k=1}^\infty \frac{(-1)^k}{k}(\zeta(s)-1)^k \frac{x^s}{s}ds+$$ $$\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}\sum\_{k=1}^\infty \frac{(-1)^k}{k}(s-1)^{-k} \frac{x^s}{s}ds.$$ 


Removing the series expansion for the logarithm, this is 


$$=\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}\left(-\log\zeta(s)\right)\frac{x^{s}}{s}ds+\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}-\log\left(\frac{s-1}{s}\right)\frac{x^{s}}{s}ds.$$ And using Perrons formula once again, since $$-\log\zeta(s)=\sum\_{k}\frac{\Lambda(n)}{\log n}n^{-s},$$ we have shown that $$\sum\_{k=1}^\infty \frac{(-1)^k}{k}H\_k(x)=\Pi(x),$$ and on the other hand the integral $$\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty} \log(s-1)\frac{x^s}{s} ds$$ gives rise to the $\text{li}(x)$ term.


