  An open conjecture of Z.-W. Sun states that for any integer $n>1$ there is a
positive integer $k\le n$ such that $\pi(kn)$ is prime, where $\pi(x)$ denotes
the number of primes not exceeding $x$. In this paper, we show that for any
positive integer $n$ the set $\{\pi(kn):\ k=1,2,3,\ldots\}$ contains infinitely
many $P_2$-numbers which are products of at most two primes. We also prove that
under the Bateman--Horn conjecture the set $\{\pi(4k):\ k=1,2,3,\ldots\}$
contains infinitely many primes.
