login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052435 a(n) = round(li(n) - pi(n)), where li is the logarithmic integral and pi(x) is the number of primes <= x. 12

%I #41 Feb 07 2023 17:10:32

%S 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,

%T 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,

%U 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

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

%C Eventually contains negative terms!

%C The logarithmic integral is the "American" version starting at 0.

%C The first crossover (P. Demichel) is expected to be around 1.397162914*10^316. - _Daniel Forgues_, Oct 29 2011

%H Harry J. Smith, <a href="/A052435/b052435.txt">Table of n, a(n) for n = 2..20000</a>

%H C. Caldwell, <a href="http://www.utm.edu/research/primes/howmany.shtml#hist">How many primes are there?</a>

%H Patrick Demichel, <a href="http://web.archive.org/web/20060908033007/http://demichel.net/patrick/li_crossover_pi.pdf">The prime counting function and related subjects</a>, April 05, 2005, 75 pages.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimeCountingFunction.html">Prime Counting Function</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LogarithmicIntegral.html">Logarithmic Integral</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SkewesNumber.html">Skewes Number</a>

%t Table[Round[LogIntegral[x]-PrimePi[x]], {x,2,100}]

%o (PARI) a(n)=round(real(-eint1(-log(n)))-primepi(n)) \\ _Charles R Greathouse IV_, Oct 28 2011

%o (Magma) [Round(LogIntegral(n) - #PrimesUpTo(n)): n in [2..105]]; // _G. C. Greubel_, May 17 2019

%o (Sage) [round(li(n) - prime_pi(n)) for n in (2..105)] # _G. C. Greubel_, May 17 2019

%Y Cf. A000720, A052434, A282870, A359145.

%K sign,look

%O 2,8

%A _Eric W. Weisstein_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 08:39 EDT 2024. Contains 371782 sequences. (Running on oeis4.)