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.

Showing 1-2 of 2 results.

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

A359145 a(n) = smallest k such that li(k) - pi(k) >= n, where li(k) is the logarithmic integral and pi(x) is the number of primes <= x.

Original entry on oeis.org

6, 10, 27, 57, 95, 148, 221, 345, 539, 806, 1270, 1393, 1407, 1422, 2590, 2645, 3292, 4888, 4930, 5374, 7406, 7442, 8511, 11578, 11653, 11671, 11765, 11774, 18997, 19066, 19135, 19204, 19362, 19372, 30621, 31925, 31935, 31946, 31956, 47038, 47264, 55573, 64993
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2023

Keywords

Comments

Suggested by the "Great Prime Number Race", which investigates when li(n) - pi(n) changes sign.
Note this is different from the smallest k such that A052435(k) >= n, because of the rounding in A052435.
Since, by the prime number theorem li(n)/pi(n) converges to 1, this sequence is probably finite.

References

  • Roger Plymen, The Great Prime Number Race, AMS, 2020.

Crossrefs

Programs

  • Mathematica
    seq[len_, kmax_] := Module[{s = Table[0, {len}], c = 0, k = 1, d}, While[c < len && k <= kmax, d = Floor[LogIntegral[k] - PrimePi[k]]; If[d > 0 && d <= len && s[[d]] == 0, Do[If[s[[i]] == 0, s[[i]] = k; c++], {i, 1, d}]]; k++]; s]; seq[50, 10^6] (* Amiram Eldar, Feb 07 2023 *)

Extensions

More terms from Amiram Eldar, Feb 07 2023
Showing 1-2 of 2 results.