OFFSET
1,5
COMMENTS
Rosser & Schoenfeld show 2*pi(x) > pi(2*x) for x > 10. - N. J. A. Sloane, Jul 03 2013, corrected Jul 09 2015
REFERENCES
J. Barkley Rosser and Lowell Schoenfeld, Abstracts of Scientific Communications, Internat. Congress Math., Moscow, 1966, Section 3, Theory of Numbers.
D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.
Sanford Segal, On Pi(x+y)<=Pi(x)+Pi(y). Transactions American Mathematical Society, 104 (1962), 523-527.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Eugene Ehrhart, On prime numbers, Fibonacci Quarterly 26:3 (1988), pp. 271-274. Shows a(n)>0 for n>10.
E. Labos, Illustration
FORMULA
a(n) ~ 2n log 2 / (log n)^2, by the prime number theorem. - N. J. A. Sloane, Mar 12 2007
EXAMPLE
n=100, pi(100)=25, pi(200)=46, 2pi(100)-pi(2*100) =4=a(100)
MATHEMATICA
f[n_] := 2 PrimePi[n] - PrimePi[2 n]; Array[f, 122] (* Robert G. Wilson v, Aug 12 2011 *)
PROG
(PARI) a(n)=2*primepi(n)-primepi(2*n) \\ Charles R Greathouse IV, Jul 02 2013
(Magma) [2*#PrimesUpTo(n) -#PrimesUpTo(2*n): n in [1..200]]; // G. C. Greubel, Aug 01 2024
(SageMath) [2*prime_pi(n) -prime_pi(2*n) for n in range(1, 201)] # G. C. Greubel, Aug 01 2024
CROSSREFS
KEYWORD
sign
AUTHOR
Labos Elemer, Mar 19 2001
EXTENSIONS
Edited by N. J. A. Sloane, Jul 03 2013
STATUS
approved