The Prime Number Theorem says that $\lim_{n \to \infty} \frac{\pi(n)}{\mathrm{Li}(n)} = 1$, where $\mathrm{Li}(x)$ is the Logarithm integral function $\mathrm{Li}(x) = \int_2^x \frac{1}{\log(x)}dx$. It is also the case that $\lim_{n \to \infty} \frac{\pi(n)}{n/\log(n)} = 1$, as $\mathrm{Li}(x)$ and $\log(x)$ are asymptotically equivalent. However it seems that $\mathrm{Li}(n)$ is a better approximation to $\pi(n)$ (the Mathworld article states that this has been proven, I don't know in what precise sense).

There are also results for the absolute difference between $\pi(n)$ and $\mathrm{Li}(n)$; for instance $\pi(n) - \mathrm{Li}(n)$ is known to change sign infinitely often. We also know that the Riemann Hypothesis is equivalent to $$ \pi(n) - \mathrm{Li}(n) \in O \left (\sqrt{n} \log(n) \right ).$$

In addition, Riemann showed that we have $$\pi(n) = \mathrm{Li}(n) - \frac{1}{2} \mathrm{Li}\left ( \sqrt{n} \right ) - \sum_{\rho} \mathrm{Li}(x^\rho) + \text{lower order terms}$$ where $\rho$ runs over all the nontrivial zeroes of the Riemann zeta function.

**Question:** Is there a sense in which $\mathrm{Li}(n)$ is the best possible approximation to $\pi(n)$? Ideally, there would be some Bohr-Mollerup type theorem: $\mathrm{Li}(n)$ is uniquely characterized as being a good approximation to $\pi(n)$ which has some properties, such as analyticity and negative second derivative. Probably $\mathrm{Li}(n)$ isn't the best possible, for instance $\mathrm{Li}(n) - \frac{1}{2} \mathrm{Li}\left ( \sqrt{n} \right )$ might be better? Riemann also suggested
$$\sum_{n \geqslant 1} \frac{\mu(n)}{n} \mathrm{Li} \left (x^\frac{1}{n}\right ),$$ where $\mu(n)$ is the Möbius function.