A060208 a(n) = 2*pi(n) - pi(2*n), where pi(i) = A000720(i).
-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
Keywords
Examples
n=100, pi(100)=25, pi(200)=46, 2pi(100)-pi(2*100) =4=a(100)
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
Programs
-
Magma
[2*#PrimesUpTo(n) -#PrimesUpTo(2*n): n in [1..200]]; // G. C. Greubel, Aug 01 2024
-
Mathematica
f[n_] := 2 PrimePi[n] - PrimePi[2 n]; Array[f, 122] (* Robert G. Wilson v, Aug 12 2011 *)
-
PARI
a(n)=2*primepi(n)-primepi(2*n) \\ Charles R Greathouse IV, Jul 02 2013
-
SageMath
[2*prime_pi(n) -prime_pi(2*n) for n in range(1,201)] # G. C. Greubel, Aug 01 2024
Formula
a(n) ~ 2n log 2 / (log n)^2, by the prime number theorem. - N. J. A. Sloane, Mar 12 2007
Extensions
Edited by N. J. A. Sloane, Jul 03 2013
Comments