# On the asymptotics of a certain sum involving the prime counting function

Let $\pi(x)$ denote the number of primes $\leq x$. What is the asymptotic form for

$$\sum_{r=1}^{\pi(x)-1} \Bigg(\frac{(\pi(x))!}{r!(\pi(x)-r)!}-\frac{(\pi(x))!}{(r-1)!(\pi(x)-r+1)!} \Bigg)$$ ?

The idea of applying the Prime Number Theorem that $\pi(x) \sim x/\log x$ seems to encounter serious troubles in considering the asymptotics of the summands, hence the bound that can be obtained via this approach seems to be quite naive.

$$S(x)=\sum_{r=1}^{\pi(x)-1} \Bigg(\frac{(\pi(x))!}{r!(\pi(x)-r)!}-\frac{(\pi(x))!}{(r-1)!(\pi(x)-r+1)!} \Bigg)$$ If you approximate $\pi(x)\simeq x/\log x$ in the summands the answer is zero, but you can carry out the sum in closed form, \begin{align*} S(x)&=\sum_{r=1}^{\pi(x)-1}\Bigg[{\pi(x)\choose r}-{\pi(x)\choose r-1}\Bigg]\\ &={\pi(x)\choose \pi(x)-1}-{\pi(x)\choose 0}=\pi(x)-1\simeq x/\log x \end{align*} for a correct nonzero answer.