PNT for composites Is it true that
\begin{align}
&c_n\sim n+\operatorname{li}(n)+\operatorname{li}(n)/\log (n),\\
\end{align}
where $c_n$ is the $n$th composite number? Is a better estimate known?
 A: By PNT we have $$\pi\left(N\right)\sim\frac{N}{\log\left(N\right)}
 $$ so if we define by $\pi_{c}\left(N\right)
 $ the number of composite number less or equal to $N
 $ we have $$\pi_{c}\left(N\right)\sim N-\frac{N}{\log\left(N\right)}=\frac{N\left(\log\left(N\right)-1\right)}{\log\left(N\right)}\,\,\,\,\,\,\,\,\,\,\,\,\,\,(1)
 $$ so observing that $$y=\frac{x\left(\log\left(x\right)-1\right)}{\log\left(x\right)}\Longrightarrow\log\left(y\right)\sim\log\left(x\right)
 $$ we can conclude, taking $N=c_{n}
 $ in $(1)
 $ $$c_{n}\sim\frac{n\log\left(n\right)}{\log\left(n-1\right)}\sim n.
 $$ Now we can make a better approximation taking the PNT in this form $$\pi\left(N\right)=\frac{N}{\log\left(N\right)}+\frac{N}{\log^{2}\left(N\right)}+o\left(\frac{N}{\log^{2}\left(N\right)}\right)
 $$ and so $$\pi_{c}\left(N\right)\sim N-\frac{N}{\log\left(N\right)}-\frac{N}{\log^{2}\left(N\right)}
 $$ hence if we take $N=c_{n}
 $ we have $$c_{n}\sim n+\frac{c_{n}}{\log\left(c_{n}\right)}+\frac{c_{n}}{\log^{2}\left(c_{n}\right)}\sim n+\frac{n}{\log\left(n\right)}+\frac{n}{\log^{2}\left(n\right)}\sim n+\textrm{Li}\left(n\right)+\frac{\textrm{Li}\left(n\right)}{\log\left(n\right)}
 $$ because $$\textrm{Li}\left(n\right)\sim\frac{n}{\log\left(n\right)}.
 $$ You can make a better approximation if you integrate by parts $\textrm{Li}\left(n\right)=\int_{2}^{n}\frac{dt}{\log\left(t\right)}$ as many times as you want.
A: Of course
$$
c_n \sim n+\operatorname{li}(n)+\operatorname{li}(n)/\log (n) \sim n
$$
so the answer is trivially true, but if I reinterpret your question as asking if
$$
c_n \stackrel{?}{=} n+\operatorname{li}(n)+\operatorname{li}(n)/\log (n)+O(n/\log^kn)
$$
for some $k$ then we can compare this to the asymptotic expansion of Bojarincev (1967):
$$
c_n = n + \frac{n}{\log n} + \frac{2n}{\log^2n} + \frac{4n}{\log^3n} + \frac{19n}{2\log^4n} + \frac{181n}{6\log^5n} + O\left(\frac{n}{\log^6n}\right)
$$
and comparing this to the expansion of $n+\operatorname{li}(n)+\operatorname{li}(n)/\log (n)$:
$$
n + \frac{n}{\log n} + \frac{2n}{\log^2n} + \frac{3n}{\log^3n} + \frac{8n}{\log^4n} + \frac{30n}{\log^5n} + O\left(\frac{n}{\log^6n}\right)
$$
I conclude that your approximation is fine, but better ones are possible. In particular
$$
c_n = n+\operatorname{li}(n)+\operatorname{li}(n)/\log (n)+O(n/\log^3n)
$$
but
$$
c_n \ne n+\operatorname{li}(n)+\operatorname{li}(n)/\log (n)+O(n/\log^kn)
$$
for any $k>3.$
