# Are there infinite many $n\in\mathbb N$ such that $\pi(n)=\sum_{p\leq\sqrt n}p$?

Are there infinite many $n\in\mathbb N$ such that $$\pi(n)=\sum_{p\leq\sqrt n}p,\tag{1}$$ where $\pi(n)$ is the Prime-counting_function?

For example, $n=1,4,11,12,29,30,59,60,179,180,389,390,391,392,\dots$

As I know, $\pi(x)\sim \dfrac{x}{\ln x},\sum_{p\leq x}p\sim \dfrac{x^2}{2\ln x}$, hence $\pi(x)\sim \sum_{p\leq \sqrt x}p$.

It seems that

• 1) it's very often that $\pi(n)>\sum_{p\leq\sqrt n}p$,
• 2) there are infinite many primes $q$ such that $q>\pi(q^2)-\sum_{p<q}p.$

If we can prove 1) and 2) then we get (1), but I can't prove even one of them.

Edit: Use the formula given by Balarka Sen, I get $$\pi(x)\sim \sum_{p\leq\sqrt x}p = \frac{x}{\ln x}(1+\frac{1+o(1)}{\ln x}),$$ but it's not enough to solve our problem.

Edit2: Use the formula given in Dusart's paper and this paper (or this post), I get $$\pi(x)=\frac{x}{\ln x}(1+\frac{1}{\ln x}+\frac{2}{(\ln x)^2}+O(\frac{1}{(\ln x)^3}))\tag 2$$

$$\sum_{p\leq\sqrt x}p =\frac{x}{\ln x}(1+\frac{1}{\ln x}+o(\frac{1}{(\ln x)^2})),\tag 3$$ so 1) is true but 2) is not, and there are only finite many $n$ satisfy $(1)$.

• There should not be. Heuristics suggests $$\sum_{p\leq \sqrt{n}} p \leq \frac{n}{\log n} \left (1 + \frac{1}{\log(n)} + \frac{16.08}{\log(n)^2} \right)$$ for some $n \geq N$ and the error with $\frac{1.25 \cdot n}{\log(n)}$, the supermum of $\pi(n)$, sign changes only finitely often. Dec 23, 2013 at 7:48
• @Balarka Sen Thanks! Where can I find that formula? Dec 23, 2013 at 8:13
• @Balarka Sen I want to see the formula of $\sum_{p\leq\sqrt n}p$. The inequality of $\pi(n)$ is correct, but I think you confuse the difference between supermum and upper bound, since $\lim_{n\to \infty}\frac{\pi(n)\ln n}{n}=1,$ I don't know how can you get that the sign of $\pi(n)-\sum_{p\leq\sqrt n}p$ changes only finitely often. Dec 23, 2013 at 12:51
• @BalarkaSen: You won't be able to disprove this conjecture by using asymptotic estimates alone. By the prime number theorem combined with partial summation $$\sum_{p\leq x}1=\int_{2}^{x}\frac{1}{\log t}dt+O\left(xe^{-c\sqrt{\log x}}\right)$$ and $$\sum_{p\leq\sqrt{x}}p=\int_{2}^{\sqrt{x}}td\left(\pi(t)\right)=\int_{2}^{\sqrt{x}}\frac{t}{\log t}dt+O\left(xe^{-c\sqrt{\log x}}\right),$$ Letting $t=\sqrt{u}$, we have that $$\int_{2}^{\sqrt{x}}\frac{t}{\log t}dt=\int_{4}^{x}\frac{1}{\log u}du,$$ and so $$\left|\sum_{p\leq x}1-\sum_{p\leq\sqrt{x}}p\right|=O\left(xe^{-c\sqrt{\log x}}\right) .$$ Dec 23, 2013 at 17:46
• I believe the conjecture is true. The only way I can think of approaching this problem is to modify Littlewood's 1914 proof that $$\pi(x)-\text{li}(x)=\Omega_{\pm}(\sqrt{x}\log \log \log x),$$ and show that it works even when we have multiple different error terms. Dec 23, 2013 at 17:56

I think they are finite :

$$\sum_{p\leq\sqrt{x}}p=\int_{2^{+}}^{\sqrt{x}}td\left(\pi(t)\right)= \sqrt{x}\pi(\sqrt{x}) -\int_{2}^{\sqrt‌​{x}}\pi (t)dt$$

suppose we have the equality for infinitely many $x$:

$$\pi(x)= \sqrt{x}\pi(\sqrt{x}) -\int_{2}^{\sqrt‌​{x}}\pi (t)dt$$

$$\sqrt{x}\pi(\sqrt{x}) - \pi(x)= \int_{2}^{\sqrt‌​{x}}\pi (t)dt$$

for $x > 55^{2}$ : $$\sqrt{x}\frac{\sqrt{x}}{log(\sqrt{x})-4}- \frac{x}{log(x)+2} >\sqrt{x}\pi(\sqrt{x}) - \pi(x)$$

$$\int_{2}^{\sqrt‌​{x}}\pi (t)dt > \int_{55}^{\sqrt‌​{x}} \frac{t}{log(t)+2}dt +C = e^{-4}\operatorname{Ei}(2(log(\sqrt{x})+2))+C$$

and :

$$e^{-4}\operatorname{Ei}(2(log(\sqrt{x})+2))+C >> \sqrt{x}\frac{\sqrt{x}}{log(\sqrt{x})-4}- \frac{x}{log(x)+2}$$ so we get a contradiction ..

What do you think ? did I miss something ?

(note : I used the fact that for $x > 55$ :

$$\frac {x}{\ln x + 2} < \pi(x) < \frac {x}{\ln x - 4}$$)

According to my computation the list should stop at 4000 or 5000 ..

• Haven't gone through your calclations, but I found quite alot examples above 5000. I searched up to $n = 2·10^9$ and the largest solution I found was 1,869,604,906. Oct 21, 2014 at 9:16
• Thank you. I'll keep my "answer" for other people to see if there a way to use it. if somebody can find a solution I would love to see it. Nov 17, 2014 at 8:57