3

I am trying to bound $$f(n)=\pi\left(\frac{n}{p_{\pi(\sqrt{n})}}\right) - \pi\left(\sqrt{n}\right)$$ where $\pi(x)$ is the prime counting function and $p_{\pi(\sqrt{n})}$ is the greatest prime number less than $\sqrt{n}$.

The lower bound is $0$, and the upper bound must be really small, as this difference counts only prime numbers $p_j$ greater than $\sqrt{n}$ such that $p_{\pi(\sqrt{n})}*p_j\leq n$. Indeed, the two local maximums I have found for $n=11^2-1=120$ and $n=127^2-1=16128$ are $f(n)=3$.

I conjecture that those are indeed global maximums, based on the fact that the relative difference $\frac{\left(\sqrt{p_{\pi(\sqrt{n})+1}^2-1}\right)-p_{\pi(\sqrt{n})}}{p_{\pi(\sqrt{n})}}$ is increasingly smaller as $n$ grows, but I do not know neither if I am right nor how to prove it.

Any help/hint would be welcomed.

Thanks!


EDIT

In line with @rtybase comment, Dusart [1] proved that, for every integer $n\geq 688383$, we have that $$n\left(\log n + \log\log n - 1+\frac{\log\log n -2.1}{\log n}\right)<p_n<n\left(\log n + \log\log n - 1+\frac{\log\log n -2}{\log n}\right)$$

Other hand, Dusart [2] proved that, for every integer $x\geq 2 953 652 287$, we have that $$\frac{x}{\log x}\left(1+\frac{1}{\log x}+\frac{2}{\log^2x}\right)\le\pi(x)\le\frac{x}{\log x}\left(1+\frac{1}{\log x}+\frac{2.334}{\log^2x}\right)$$

As we already know that the lower bound of $f(n)$ is 0, we will focus only in deriving the tightest upper bound possible.

Applying Dusart's bounds for $p_n$, we get that $$f(n)<\pi\left(\frac{n}{\sqrt{n}(\log \sqrt{n} + \log\log \sqrt{n} - 1+\frac{\log\log \sqrt{n} -2}{\log \sqrt{n}}}\right) - \pi\left(\sqrt{n}\right)$$

Simplifying,

$$f(n)<\pi\left(\frac{\sqrt{n}}{\log \sqrt{n} + \log\log \sqrt{n} - 1+\frac{\log\log \sqrt{n} -2}{\log \sqrt{n}}}\right) - \pi\left(\sqrt{n}\right)$$

Applying Dusart's bounds for $\pi(n)$, we get that

$$f(n)<\frac{\frac{\sqrt{n}}{\log \sqrt{n} + \log\log \sqrt{n} - 1+\frac{\log\log \sqrt{n} -2}{\log \sqrt{n}}}}{\log \frac{\sqrt{n}}{\log \sqrt{n} + \log\log \sqrt{n} - 1+\frac{\log\log \sqrt{n} -2}{\log \sqrt{n}}}}\left(1+\frac{1}{\log \frac{\sqrt{n}}{\log \sqrt{n} + \log\log \sqrt{n} - 1+\frac{\log\log \sqrt{n} -2}{\log \sqrt{n}}}}+\frac{2.334}{\log^2\frac{\sqrt{n}}{\log \sqrt{n} + \log\log \sqrt{n} - 1+\frac{\log\log \sqrt{n} -2}{\log \sqrt{n}}}}\right)-\frac{\sqrt{n}}{\log \sqrt{n}}\left(1+\frac{1}{\log \sqrt{n}}+\frac{2}{\log^2\sqrt{n}}\right)$$

We can reexpress it as

$$f(n)<\frac{\sqrt{n} \left(\frac{\log\sqrt{n}}{(1 + \log\sqrt{n}) (-2 + \log(\sqrt{n}) + \sqrt{n} \log(\log(n)))}\right)}{\log \sqrt{n} +\log\left(\frac{\log\sqrt{n}}{(1 + \log\sqrt{n}) (-2 + \log(\sqrt{n}) + \sqrt{n} \log(\log(n)))}\right)}\left(1+\frac{1}{\log \sqrt{n} +\log\left(\frac{\log\sqrt{n}}{(1 + \log\sqrt{n}) (-2 + \log(\sqrt{n}) + \sqrt{n} \log(\log(n)))}\right)}+\frac{2.334}{\log^2\sqrt{n} +\log\left(\frac{\log\sqrt{n}}{(1 + \log\sqrt{n}) (-2 + \log(\sqrt{n}) + \sqrt{n} \log(\log(n)))}\right)}\right)-\frac{\sqrt{n}}{\log \sqrt{n}}\left(1+\frac{1}{\log \sqrt{n}}+\frac{2}{\log^2\sqrt{n}}\right)$$

Can we from this point go further to obtain that $f(n)$ is less than some constanc $C$?


[1] P. Dusart, Explicit estimates of some functions over primes, Ramanujan J. 45 (2018), no. 1, 227–251.

[2] Pierre Dusart, "Estimates of Some Functions Over Primes without R.H." (2010) https://arxiv.org/abs/1002.0442

Juan Moreno
  • 1,074
  • I think it should be $P_{\sqrt{n}}$ and not $P_{\pi(\sqrt{n})}$ – Kamal Saleh Oct 19 '23 at 19:23
  • 1
    @KamalSaleh no, it is correct as stated, as $p_{\pi(\sqrt{n})}$ is the greatest prime number less than $\sqrt{n}$ – Juan Moreno Oct 19 '23 at 19:41
  • https://en.wikipedia.org/wiki/Formula_for_primes Also $\sqrt{n}$ is only an integer when $n$ is a perfect square. I am pretty sure you meant $\lfloor\sqrt{n}\rfloor$ or the integer part of $\sqrt{n}$ – Kamal Saleh Oct 19 '23 at 19:58
  • 1
    @KamalSaleh $\pi(x)$ is always integer, so where exactly do you think I meant what do you think I meant? – Juan Moreno Oct 19 '23 at 21:32
  • Is $\sqrt{2}$ an integer? – Kamal Saleh Oct 19 '23 at 23:30
  • 1
    Something to begin with: for large enough $x$'s $$x-\frac{x}{\log{x}}<p_{\pi(x)}\leq x$$ and given that $\pi(x)$ is ascending: $$\sqrt{n}-\frac{\sqrt{n}}{\log{\sqrt{n}}}<p_{\pi(\sqrt{n})}\leq \sqrt{n} \Rightarrow\ \frac{n}{\sqrt{n}-\frac{\sqrt{n}}{\log{\sqrt{n}}}}>\frac{n}{p_{\pi(\sqrt{n})}}\geq \frac{n}{\sqrt{n}} \Rightarrow\ \pi\left(\frac{\sqrt{n}}{1-\frac{2}{\log{n}}}\right) \geq\pi\left(\frac{n}{p_{\pi(\sqrt{n})}}\right)\geq \pi\left(\sqrt{n}\right)$$ – rtybase Oct 20 '23 at 06:30
  • 1
    @rtybase thanks! Definitely that type of bounds could be useful – Juan Moreno Oct 20 '23 at 07:15

2 Answers2

0

Just a remark :

Some days ago I made a conjecture let's try it :

Let $x\geq M>0$ ,$M$ sufficiently large then it seems we have for $C_i$ positive constant :

$$\frac{\pi{(x)}}{\pi{(\pi{(x)}})}\simeq \ln(x)-\ln(\ln(x))-1-\sum_{i=1}^{\infty}\left(C_i\left(\frac{\operatorname{li}\left(x\right)}{x}\ln\left(x\right)-1\right)^{1+i}\right)\tag{I}$$

I'm not a specialist in number theory so give me your feedback about it and how it enlighten the question here.

Barackouda
  • 3,879
-1

I think I have a correct proof that $$0\leq \pi\left(\frac{n}{p_{\pi(\sqrt{n})}}\right) - \pi\left(\sqrt{n}\right)\leq 3 \space \forall n>4 $$ We do not need bounds as tight as the ones proposed in the OP; we need only that $$n(\log n +f(n))<p_n<n(\log n + g(n))\quad (1)$$ and $$\frac{x}{\log x}(f'(x))<\pi(x)<\frac{x}{\log x}(g'(x))\quad (2)$$ Where $f(n)<g(n)$ and $1<f'(x)<g'(x)$ are positive increasing functions.

Bounds as the ones described are less tight that the ones found in the literature, so we will take them as proved.

As stated in the OP, the difference counts only prime numbers $p_j$ such that $p_{\pi(\sqrt{n})}*p_j\leq n$.

It is clear that $p_j=p_{\pi(\sqrt{n})+k}$, where $k$ is precisely the value we want to bound.

From (1), we have that $$p_{\pi(\sqrt{n})}>\pi(\sqrt{n})\left(\log \pi(\sqrt{n}) + f(\pi(\sqrt{n})\right)$$ $$p_{\pi(\sqrt{n})+k}<(\pi(\sqrt{n})+k)\left(\log (\pi(\sqrt{n})+k) + g(\pi(\sqrt{n})+k)\right)$$

Therefore, we have that $$\left(\pi(\sqrt{n})\left(\log \pi(\sqrt{n}) + f(\pi(\sqrt{n})\right)\right)*(\pi(\sqrt{n})+k)\left(\log (\pi(\sqrt{n})+k) + g(\pi(\sqrt{n})+k)\right)\leq n \quad (3)$$

We can divide both sides of (3) by $\pi(\sqrt{n})$ to get $$\left(\log \pi(\sqrt{n}) + f(\pi(\sqrt{n})\right)*(\pi(\sqrt{n})+k)\left(\log (\pi(\sqrt{n})+k) + g(\pi(\sqrt{n})+k)\right)\leq \frac{n}{\pi(\sqrt{n})} \quad (4)$$

From (2), we have that $\frac{n}{\pi(\sqrt{n})}$ is maximum when $\pi(\sqrt{n})=\frac{\sqrt{n}}{\log \sqrt{n}}(f'(\sqrt{n}))$. We have then that $$\frac{n}{\pi(\sqrt{n})}\leq \frac{n}{\frac{\sqrt{n}}{\log \sqrt{n}}(f'(\sqrt{n}))}$$ $$\frac{n}{\pi(\sqrt{n})}\leq \frac{\sqrt{n} \log \sqrt{n}}{(f'(\sqrt{n}))}$$

Note that $$\frac{\sqrt{n} \log \sqrt{n}}{(f'(\sqrt{n}))}=\frac{\pi(\sqrt{n})*\log^2(\sqrt{n})}{(f'(\sqrt{n}))^2}$$

Therefore, substituting in (4), we have that $$\left(\log \pi(\sqrt{n}) + f(\pi(\sqrt{n})\right)*(\pi(\sqrt{n})+k)\left(\log (\pi(\sqrt{n})+k) + g(\pi(\sqrt{n})+k)\right)\leq \frac{\pi(\sqrt{n})*\log^2(\sqrt{n})}{(f'(\sqrt{n}))^2}$$

As $(f'(\sqrt{n}))^2>1$, we have that $$\left(\log \pi(\sqrt{n}) + f(\pi(\sqrt{n})\right)*(\pi(\sqrt{n})+k)\left(\log (\pi(\sqrt{n})+k) + g(\pi(\sqrt{n})+k)\right)\leq \pi(\sqrt{n})*\log^2(\sqrt{n})$$

Noting that $$(\log \pi(\sqrt{n})(\pi(\sqrt{n})+k)(\log (\pi(\sqrt{n})+k))\geq \pi(\sqrt{n})*\log^2(\sqrt{n})$$ yields that $k=0$ when both (1) and (2) are satisfied.

As in the literature it is known that (1) and (2) are satisfied for all positive reals greater than sufficiently small checkeable values (say, for instance, $p_{100}$ for (1) (Rosser and Schoenfeld), and $x=20$ for (2) (Dussart)), we can check manually that the proposed bounds $0\leq\pi\left(\frac{n}{p_{\pi(\sqrt{n})}}\right) - \pi\left(\sqrt{n}\right)\leq 3$ are correct for those values, and we are done.

EDIT

I would appreciate your feedback to check that the proof is correct and I have not made any mistake. Thanks!

Juan Moreno
  • 1,074