New fast methods to compute the number of primes less than a given value - Teruel, G. R. P. (Ukrains’kyi Matematychnyi Zhurnal, 2022)
UDC 519.688The paper describes new fast algorithms for evaluating $π(x)$ inspired by the harmonic and geometric mean integrals that can be used on any pocket calculator. In particular, the formula $h(x)$ based on the harmonic mean is within $≈ 15$ of the actual value for $3≤ x≤ 10000.$ The approximation verifies the inequality, $h(x)≤ {\rm Li}(x)$ and, therefore, is better than ${\rm Li}(x)$ for small $x.$ We show that $h(x)$ and their extensions are more accurate than other famous approximations, such as Locker–Ernst's or Legendre's also for large $x.$ In addition, we derive another function $g(x)$ based on the geometric mean integral that employs $h(x)$ as an input, and allows one to significantly improve the quality of this method. We show that $g(x)$ is within $≈ 25$ of the actual value for $x≤ 50000$ (to compare ${\rm Li}(x)$ lies within $≈ 40$ for the same range) and asymptotically $g(x)\sim \dfrac{x}{\ln x}\exp\left(\dfrac{1}{\ln x-1}\right).$