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.

A052435 a(n) = round(li(n) - pi(n)), where li is the logarithmic integral and pi(x) is the number of primes <= x.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 4, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 4, 5, 5, 5, 4, 5, 4
Offset: 2

Views

Author

Keywords

Comments

Eventually contains negative terms!
The logarithmic integral is the "American" version starting at 0.
The first crossover (P. Demichel) is expected to be around 1.397162914*10^316. - Daniel Forgues, Oct 29 2011

Crossrefs

Programs

  • Magma
    [Round(LogIntegral(n) - #PrimesUpTo(n)): n in [2..105]]; // G. C. Greubel, May 17 2019
    
  • Mathematica
    Table[Round[LogIntegral[x]-PrimePi[x]], {x,2,100}]
  • PARI
    a(n)=round(real(-eint1(-log(n)))-primepi(n)) \\ Charles R Greathouse IV, Oct 28 2011
    
  • Sage
    [round(li(n) - prime_pi(n)) for n in (2..105)] # G. C. Greubel, May 17 2019