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.

A079715 a(n) = pi(n) - pi(sqrt(n)) + 1.

Original entry on oeis.org

1, 2, 3, 2, 3, 3, 4, 4, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19
Offset: 1

Views

Author

Benoit Cloitre, Feb 16 2003

Keywords

Comments

A well-known application of the principle of inclusion-exclusion used in sieve methods.
Number of numbers less than or equal to n and coprime to the product of the primes less than sqrt(n), i.e., to A104588(n). - Lekraj Beedassy, Mar 17 2005

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[n] - PrimePi[Sqrt[n]] + 1, {n, 1, 100}] (* G. C. Greubel, May 13 2017 *)
  • PARI
    for(n=1,100, print1(primepi(n) - primepi(sqrt(n)) + 1, ", ")) \\ G. C. Greubel, May 13 2017

Formula

a(n) = pi(n) - pi(sqrt(n)) + 1 = A000720(n) - A056811(n) + 1 = A056812(n) + 1.
a(n) = Sum_{k=1..n} mu(k)*floor(n/k) where each prime factor of k is <= sqrt(n). [Corrected by Steven Foster Clark, May 03 2023]

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 12 2007