According to the prime number theorem there are about $n/\ln(n)$ primes less than $n$. This value is a limit but it could fluctuate. My question is, is there a known bound on this fluctuation? i.e. are there functions $f$ and $g$ such that $\forall n>100, f(n) < \mathrm{numPrimes}(n) \lt g(n)$? How tight is this bound? Could there be an $n$ for which the number of primes less than $n$ is smaller than $n/\sqrt{n}$? Could there be an $n$ for which there are more than $n/2$ (for $n\gt 100$ let's say) primes less than $n$?


Trivially $0 \lt\mathrm{numPrimes}(n) \lt n$, how tight a bound has been achieved?



Min number of primes up to n
Let $\pi(x)$ denote the prime counting function. Pierre Dusart has [shown](http://arxiv.org/abs/1002.0442) that
$$\pi(x) \geq \frac{x}{\log(x)-1} \qquad \qquad \mbox{ for }x\geq 5393$$ and $$\pi(x) \leq \frac{x}{\log(x)-1.1}\qquad \qquad \mbox{ for } x\geq 60184.$$


Many other results of a similar flavor are also shown in this paper.


