OFFSET
1,2
COMMENTS
This is an improvement over the classic X / log(X) approximation in the range many people work with.
pi(x), R(x), and li(x) are all asymptotically x/log x + x/log^2 x + O(x/log^3 x), so this approximation is good around exp(1/.022) ≈ 5 * 10^19. Asymptotically the best value for K would be 1. - Charles R Greathouse IV, Aug 18 2022
FORMULA
a(n) = abs(round(1.022*10^n/log(10^n)) - pi(10^n)). - Charles R Greathouse IV, Mar 22 2015
a(n) ~ 10^n/kn with k = 104.6629.... - Charles R Greathouse IV, Mar 22 2015
EXAMPLE
a(10)=11203550 via abs (455,052,511 - 443,848,961).
MATHEMATICA
Table[ PrimePi[10^n] - Round[N[1.022*10^n/Log[10^n]]], {n, 23}] (* and absolute value thereof (orig entries 21-23 <0); courtesy of Robert G. Wilson v *)
PROG
(PARI) a(n) = abs(round(1.022*10^n/log(10^n)) - primepi(10^n)) \\ Charles R Greathouse IV, Mar 22 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Bill McEachen, Apr 23 2007
STATUS
approved