<s>[INST] Fraction of prime number between consecutive powers of two A $n$-bit integer is an integer $x$ such that $2^{n-1} \le x < 2^n$. In [1] it is claimed without proof that a corollary of the prime number theorem is that:

For any $n > 1$, the fraction of $n$-bit integers that are prime is at least $\frac{1}{3n}$.

Can somebody point me to a proof of this?
It is (perhaps) worth noticing that a direct application of the prime number theorem allows to prove an asymptotic version of the above (with a slightly better constant).
$$
\begin{align*}
\lim_{n \to \infty} \frac{n \ln 2}{2^{n-1}} \bigg( \pi(2^n-1) - \pi(2^{n-1})\bigg) &= 
\lim_{n \to \infty} \frac{n \ln 2}{2^{n-1}} \bigg(  \pi(2^n) - \pi(2^{n-1}) \bigg) \\&=
\lim_{n \to \infty} \frac{n \ln 2}{2^{n-1}}  \bigg( \frac{2^n}{n \ln 2}  - \frac{2^{n-1}}{(n-1)\log2} \bigg)\\ & =
\lim_{n \to \infty} \frac{n \ln 2}{2^{n-1}}  \bigg( \frac{2^n}{2n \ln 2 } \cdot\frac{n-2}{n-1}   \bigg) = 1.
\end{align*}
$$
Therefore $\frac{\pi(2^n-1) - \pi(2^{n-1})}{2^{n-1}} \sim \frac{1}{n \ln 2}$, and for every $\varepsilon >0$ there is some $n_0$ such that, for all $n \ge n_0$, the fraction of $n$-bit integers that are prime is at least $\frac{1-\varepsilon}{n \ln 2}$.
A not-so-elegant way to prove the the claim would be that of choosing $\varepsilon =1-\frac{\ln 2}{3} \approx 0.7689$ and finding an upper bound on $n_0$ that lies in the range for which $\pi(\cdot)$ has been computed. Are such upper bounds known?
[1] Jonathan Katz, Yehuda Lindell. Introduction to Modern Cryptography (3rd edition).  CRC Press. ISBN 9781351133012.
 [/INST] According to
the classic article
"Explicit Bounds for Some Functions of Prime Numbers",
Barkley Rosser
American Journal of Mathematics
Vol. 63, No. 1 (Jan., 1941), pp. 211-232 (22 pages)
for $x \ge 55$,
$\dfrac{x}{\log x+2}
\lt \pi(x)
\lt \dfrac{ x}{\log x-4}
$.
Therefore,
putting $x=2^n$,
$\dfrac{ 2^n}{n\log 2+2}
\lt \pi(2^n)
\lt \dfrac{ 2^n}{n\log 2-4}
$.
Therefore
$\dfrac{ 2^n}{n\log 2+2}-\dfrac{ 2^{n-1}}{(n-1)\log 2-4}
\lt \pi(2^n)-\pi(2^{n-1})
\lt \dfrac{ 2^n}{n\log 2-4}-\dfrac{ 2^{n-1}}{(n-1)\log 2+2}
$.
Those differences are about
(more explicitness later)
$\begin{array}\\
D
&=\dfrac{ 2^n}{n\log 2}-\dfrac{ 2^{n-1}}{(n-1)\log 2}\\
&=\dfrac{ 2^n}{n\log 2}\left(1-\dfrac{\frac12}{1-\frac1{2n}}\right)\\
&=\dfrac{ 2^n}{n\log 2}\left(\dfrac{1-\frac1{2n}-\frac12}{1-\frac1{2n}}\right)\\
&=\dfrac{ 2^n}{n\log 2}\left(\dfrac{\frac12-\frac1{2n}}{1-\frac1{2n}}\right)\\
&=\dfrac{ 2^n}{2n\log 2}\left(\dfrac{1-\frac1{n}}{1-\frac1{2n}}\right)\\
&=\dfrac{ 2^n}{2n\log 2}\left(\dfrac{1-\frac1{2n}-\frac1{2n}}{1-\frac1{2n}}\right)\\
&=\dfrac{2^n}{2n\log 2}\left(1-\dfrac{\frac1{2n}}{1-\frac1{2n}}\right)\\
&=\dfrac{2^n}{2n\log 2}\left(1-\dfrac{1}{2n-1}\right)\\
&\approx\dfrac{ 2^n}{2n\log 2}\\
\end{array}
$
For the lower bound,
$\begin{array}\\
L(n)
&=\dfrac{ 2^n}{n\log 2+2}-\dfrac{ 2^{n-1}}{(n-1)\log 2-4}\\
&=\dfrac{ 2^n((n-1)\log 2-4)-2^{n-1}(n\log 2+2)}{(n\log 2+2)((n-1)\log 2-4)}\\
&=\dfrac{ 2^{n-1}(2(n-1)\log 2-8)-(n\log 2+2))}{n(n-1)\log^22-4n\log 2+2(n-1)\log 2-8}\\
&=\dfrac{2^{n-1}(n \log 2-2\log 2-10)}{n(n-1)\log^22-2n\log 2+2\log 2-8}\\
\end{array}
$
I will leave it at this for now,
and a similar expression
can be derived for the
upper bound.
</s>