cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A060208 a(n) = 2*pi(n) - pi(2*n), where pi(i) = A000720(i).

Original entry on oeis.org

-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

Views

Author

Labos Elemer, Mar 19 2001

Keywords

Comments

Rosser & Schoenfeld show 2*pi(x) > pi(2*x) for x > 10. - N. J. A. Sloane, Jul 03 2013, corrected Jul 09 2015

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.

Crossrefs

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) = 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

Extensions

Edited by N. J. A. Sloane, Jul 03 2013