login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A060208
a(n) = 2*pi(n) - pi(2*n), where pi(i) = A000720(i).
10
-1, 0, 1, 0, 2, 1, 2, 2, 1, 0, 2, 1, 3, 3, 2, 1, 3, 3, 4, 4, 3, 2, 4, 3, 3, 3, 2, 2, 4, 3, 4, 4, 4, 3, 3, 2, 3, 3, 3, 2, 4, 3, 5, 5, 4, 4, 6, 6, 5, 5, 4, 3, 5, 4, 3, 3, 2, 2, 4, 4, 6, 6, 6, 5, 5, 4, 6, 6, 5, 4, 6, 6, 8, 8, 7, 6, 6, 6, 7, 7, 7, 6, 8, 7, 7, 7, 6, 6, 8, 7, 6, 6, 6, 6, 6, 5, 6, 6, 5, 4, 6, 6, 8, 8, 8, 7, 9, 9, 11, 11, 11, 10, 12, 11, 10, 10, 9, 9, 9, 8, 7, 7
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
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) = Mod[2*PrimePi[n], PrimePi[2n]] = 2*A000720(n) - A000720(2n) for n>1.
a(n) ~ 2n log 2 / (log n)^2, by the prime number theorem. - N. J. A. Sloane, Mar 12 2007
a(n) = -A047886(n,n) (see A212210 to A212213). - Reinhard Zumkeller, Apr 15 2008
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
KEYWORD
sign
AUTHOR
Labos Elemer, Mar 19 2001
EXTENSIONS
Edited by N. J. A. Sloane, Jul 03 2013
STATUS
approved