Variations on $\pi(2n)-\pi(n)$

56 Views Asked by At

I have taking a glance to the sequence $a_n=\pi(2n)-\pi(n)$ for $n\in\Bbb N$, where $\pi$ is the prime counting function ($\Bbb N$ does not include $0$ in this post).

You can see some terms here: https://oeis.org/A108954

It seems that $|a_{n+1}-a_n|\le1$ for every $n\in\Bbb N$. This is actually very easy to prove, since $$a_{n+1}-a_n=\begin{cases} 1\text{ if $n$ is not prime and $2n-1$ is prime}\\ 0\text{ if $n$ and $2n-1$ are both prime or both composite}\\ -1\text{ if $n$ is prime and $2n-1$ is not prime} \end{cases} $$

Thus, $a_n$ can be defined by recurrence: $a_1=1$, and $a_{n+1}$ defined as before (simply add $a_n$ to both sides for a proper definition).

Let $c_r$ (https://oeis.org/A174166) be the increasing sequence of composite numbers $k$ such that $2k-1$ is prime, and let $q_r$ (https://oeis.org/A307390) the increasing sequence of prime numbers $k$ such that $2k-1$ is composite. For each $n\in N$ let $C_n$ the set of the terms $c_r\le n$ and $Q_n$ the set of the terms $q_r\le n$. Then $$a_n=1+\#C_n-\#Q_n$$

(Note: $C_j$ and $Q_j$ are empty for $j\le 3$). For example, $$C_{10}=\{4,6,9,10\},C_{11}=\{4,6,9,10\}$$ $$Q_{10}=\{5\},Q_{11}=\{5,11\}$$

Bertrand's postulate implies that $\#C_n\ge\#Q_n$ for every $n\in\Bbb N$.

The question: I feel that all this reasoning about the sequence $a_n$ must lead to a Bertrand's postulate proof. The point would be to prove that the sets $C_n$ grow faster enough than the sets $Q_n$. (In other words, that the sequence $q_r$ grows faster than $c_r$). Is there some proof that uses this ideas?