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-10 of 11 results. Next

A057752 Difference between nearest integer to Li(10^n) and pi(10^n), where Li(x) = integral of log(x) and pi(10^n) = number of primes <= 10^n (A006880).

Original entry on oeis.org

2, 5, 10, 17, 38, 130, 339, 754, 1701, 3104, 11588, 38263, 108971, 314890, 1052619, 3214632, 7956589, 21949555, 99877775, 222744644, 597394254, 1932355208, 7250186216, 17146907278, 55160980939, 155891678121, 508666658006, 1427745660374, 4551193622464
Offset: 1

Views

Author

Robert G. Wilson v, Oct 30 2000

Keywords

Comments

On his prime pages C. K. Caldwell remarks: "However in 1914 Littlewood proved that pi(x)-Li(x) assumes both positive and negative values infinitely often". - Frank Ellermann, May 31 2003

References

  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus, an imprint of Springer-Verlag, NY, 1995, page 146.
  • Marcus du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see table on p. 90.

Crossrefs

Programs

  • Mathematica
    Table[Round[LogIntegral[10^n] - PrimePi[10^n]], {n, 1, 13}]
  • PARI
    A057752=vector(#A006880,i,round(-eint1(-log(10^i))-A006880[i])) \\ M. F. Hasler, Feb 26 2008
    
  • Python
    from sympy import N, li, primepi, floor
    def round(n):
        return int(floor(n+0.5))
    def A057752(n):
        return round(N(li(10**n),10*n)) - primepi(10**n) # Chai Wah Wu, Apr 30 2018

Extensions

More terms from Frank Ellermann, May 31 2003
The value of a(23) is not known at present, I believe. - N. J. A. Sloane, Mar 17 2008
Name corrected and extended for last two terms a(23) and a(24), with Pi(10^n) for n=23 and 24 from A006880, by Vladimir Pletser, Mar 10 2013
a(25)-a(27) added, using data from A006880, by Chai Wah Wu, Apr 30 2018
a(28) added, using data from A006880, by Eduard Roure Perdices, Apr 14 2021
a(29) added, using data from A006880, by Reza K Ghazi, May 10 2022

A057754 Integer nearest to Li(10^n), where Li(x) = integral(0..x, dt/log(t)).

Original entry on oeis.org

6, 30, 178, 1246, 9630, 78628, 664918, 5762209, 50849235, 455055615, 4118066401, 37607950281, 346065645810, 3204942065692, 29844571475288, 279238344248557, 2623557165610822, 24739954309690415, 234057667376222382
Offset: 1

Views

Author

Robert G. Wilson v, Oct 30 2000

Keywords

Comments

"Li[z] is central to the study of the distribution of primes in number theory. The logarithmic integral function is sometimes also denoted by Li(z). In some number-theoretical applications li(z) is defined as [integral from 2 to z of 1/log(t) dt], with no principal value taken. This differs from the definition used in 'Mathematica' by the constant li(2)."

Examples

			Li( 10^22 ) = 201467286691248261498.15... => a(22).
pi( 10^22 ) = 201467286689315906290.
		

Crossrefs

A052435( 10^n ) = a(n) - pi( 10^n ) for n > 0.

Programs

  • Magma
    [Round(LogIntegral(10^n)): n in [1..25]]; // G. C. Greubel, May 17 2019
    
  • Maple
    seq(round(evalf(Li(10^n), 64)), n=1..19); # Peter Luschny, Mar 20 2019
  • Mathematica
    Table[Round[LogIntegral[10^n]], {n, 1, 25}]
  • PARI
    vector(25, n, round(real(-eint1(-log(10^n)))) ) \\ G. C. Greubel, May 17 2019
    
  • Sage
    [round(li(10^n)) for n in (1..25)] # G. C. Greubel, May 17 2019

Formula

a(n) = round( Li( 10^n )) = round( Ei( log( 10^n ))).

A210439 The minimal Skewes number for prime n-tuplets.

Original entry on oeis.org

1369391, 337867, 1172531, 21432401, 251331775687, 7572964186421, 1203255673037261
Offset: 2

Views

Author

Alexei Kourbatov, Jan 20 2013

Keywords

Comments

More formally: the least prime in the prime n-tuplet at which for the first time pi_n(p) > C_n*Li_n(p). Here pi_n(p) is the n-tuplet counting function; C_n is the Hardy-Littlewood constant, and Li_n(x) is the integral from 2 to x of (1/(log t)^n) dt.
If, for a given n, there is more than one type of n-tuplets, then a(n) is determined by the n-tuplet type for which the first sign change of pi_n - C_n*Li_n occurs earlier than for the other type(s).
For the special case n=1, the term a(1) is the Skewes number, i.e., the first prime p for which pi(p) > Li(p). The term a(1) is not included in the sequence because it is not precisely known.

Examples

			Initially, for twin primes we have pi_2(p) < C_2 Li_2(p). The inequality is reversed for the first time for the 10744th pair of twin primes (1369391,1369393), therefore a(2) = 1369391.
Similarly, for prime triples (p,p+4,p+6), pi_3(p) < C_3 Li_3(p) until the 652nd triple (337867,337871,337873) where the inequality is reversed for the first time. Thus a(3)=337867. (The reversal for the other type of triples (p,p+2,p+6) occurs much later, so triples (p,p+2,p+6) do not contribute a term to this sequence.)
From _Hugo Pfoertner_, Aug 26 2021, Oct 24 2021: (Start)
a(8) corresponds to the 134292-th 8-tuple of the form p + [0, 2, 6, 8, 12, 18, 20, 26], found using a program provided by _Norman Luhn_. This type of 8-tuple is the one that leads to the earliest crossing of the corresponding comparison value (see linked illustration), while the other two possible configurations (enumerated in A022012 and A022013 or in A346997 and A346998) are still far from crossing their respective applicable comparison values. The other two possible 8-tuples, which lead to the crossing that occurs later, determine the terms A332493(8) and A348053(8), dependent on the criterion applied to decide what is "later". (End)
		

Crossrefs

Cf. A052435 (round(li(n)-pi(n)), where li is the logarithmic integral and pi(x) is the prime counting function).
Cf A022011, A022012, A022013, A346996, A346997, A346998 (related to 8-tuplets).

Programs

  • PARI
    \\ See Alexei Kourbatov link.

Extensions

a(7) from Hugo Pfoertner, May 09 2020
a(8) from Hugo Pfoertner, Aug 26 2021

A052434 Nearest integer to R(n) - pi(n), where R(x) is the Riemann prime counting function.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0
Offset: 2

Views

Author

Keywords

Comments

The Riemann prime counting function R(n) = Sum_{prime powers p^k <= n} 1/k = A096624(n)/A096625(n). - N. J. A. Sloane, Feb 07 2023

Examples

			a(13) = 0 because R(13) = 5.504 and pi(13) = 6.
		

Crossrefs

Programs

Extensions

Corrected 6 terms, a(2), a(7), a(10), a(13), a(20) and a(48). Each was made 1 larger. Also gave an example for a(13) and a program for computing a(n). - Harry J. Smith, Dec 31 2008

A223853 a(n) = ceiling(li(2*2^n) - li(2^n)) - (pi(2*2^n) - pi(2^n)) with li(x) the logarithmic integral and pi(x) the prime counting function.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 3, 4, 1, 7, 1, 13, 10, 4, 25, -5, 49, 17, 38, 82, 103, -55, 245, 290, 105, 621, -107, 1219, 1196, -274, 1749, 5329, 2881, 2451, 6836, 2910, 15905, 28044, -10652, 55758, 18068, 129994, -95925, 52787, 443983, 253331, 151395, 740898, -352415
Offset: 1

Views

Author

Brad Clardy, Mar 28 2013

Keywords

Comments

This is the difference between the estimate for the number of primes in power of two intervals determined by the li approximation, and the actual number of primes in the power of two interval. The MAGMA program gives the ceiling of the difference between the li estimate at the end points of the interval and the actual number of primes in the interval (A036378).
H. J. J. te Riele (1987) using methods developed by Lehman (1966) showed that between 6.62*10^370 and 6.69*10^370 there are more than 10^180 consecutive integers where pi(x) > li(x). It is worth noting that this falls entirely within the power of two interval starting at 2^1231, and while the condition "li underestimates the number of primes in an interval" is not sufficient to imply that pi(x) > li(x), for example in (2^18, 2^19) li(x) underestimates by 5 but li(x) > pi(x) at every point in the interval, it does seem to be necessary for this to occur, assuming runs of consecutive values where pi(x) > li(x) do not cross a power of two.

Crossrefs

Programs

  • Magma
    1;
    for i := 2 to 29 do
        x := 2^i;
        y := 2^(i+1);
        delta_li := Ceiling(LogIntegral(y) - LogIntegral(x));
        delta_pi := #PrimesInInterval(x, y);
        delta_li - delta_pi;
    end for;
  • Mathematica
    pi = Table[PrimePi[2^n], {n, 1, 30}];
    li = Table[LogIntegral[2^n], {n, 1, 30}];
    Ceiling[Rest@li - Most@li] - (Rest@pi - Most@pi) (* Peter Luschny, Oct 14 2017 *)

Formula

a(n) = A223900(n) - A036378(n).

A053622 a(n) = round( n/log(n) - pi(n) ).

Original entry on oeis.org

2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -1, -1, -1, -2, -2, -1, -1, -2, -2, -3, -2, -2, -2, -3, -3, -2, -2, -2, -2, -3, -2, -2, -2, -2, -2, -3, -2, -3, -3, -3, -3, -2, -2, -3, -3, -3, -3, -3, -3
Offset: 2

Views

Author

Henry Bottomley, Mar 21 2000

Keywords

Crossrefs

Programs

  • Magma
    [Round(n/Log(n) - #PrimesUpTo(n)): n in [2..80]]; // G. C. Greubel, May 17 2019
    
  • Mathematica
    Table[Round[n/Log[n] - PrimePi[n]], {n,2,80}] (* G. C. Greubel, Apr 20 2017 *)
  • PARI
    vector(80, n, n++; round(n/log(n) - primepi(n)) ) \\ G. C. Greubel, May 17 2019
    
  • Sage
    [round(n/log(n) - prime_pi(n)) for n in (2..80)] # G. C. Greubel, May 17 2019

Formula

a(n) = A050499(n) - A000720(n).

A229256 Difference between PrimePi(10^n) and its approximation by A229255(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 10, 223, 144, -9998, -58280, 348134, 9517942, 92182430, 404027415, -2717447318, -79612186200, -983858494247, -7964818545554, -31776540093807, 289145607666924, 8243854930562789, 108476952917770938, 885519807642948390, 715407405727600672, -147909423143942345447
Offset: 1

Views

Author

Vladimir Pletser, Sep 17 2013

Keywords

Comments

A229255 provides exact values of pi(10^n) for n=1 to 5 and yields an average relative difference in absolute value of Average(Abs(A229256(n))/pi(10^n)) = 2.05820...*10^-4 for 1<=n<=25.
A229255 provides a better approximation to the distribution of pi(10^n) than: (1) the Riemann function R(10^n) as the sequence of integers nearest to R(10^n), Average(Abs(A057794 (n))/pi(10^n)) =1.219...*10^-2; (2) the functions of the logarithmic integral Li(x) whether as the sequence of integer nearest to (Li(10^n)-Li(3)) (A223166) (Average(Abs(A223167(n))/pi(10^n))= 7.4969...*10^-3), or as Gauss’ approximation to pi(10^n), i.e. the sequence of integer nearest to (Li(10^n)-Li(2)) (A190802) (Average(Abs(A106313(n))/pi(10^n)) =2.0116...*10^-2), or as the sequence of integer nearest to Li(10^n) (A057752) (Average(Abs(A057752 (n))/pi(10^n)) =3.2486...*10^-2).

References

  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus, an imprint of Springer-Verlag, NY, 1996, page 144.

Crossrefs

Formula

a(n) = A006880(n) - A229255(n).

A282870 a(n) = floor( Li(n) - pi(n) ).

Original entry on oeis.org

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

Views

Author

David S. Newman, Feb 23 2017

Keywords

Comments

Li(x) is the logarithmic integral of x.
pi(x) is the number of primes less than or equal to x, A000720(x).
"The Riemann hypothesis is an assertion about the size of the error term in the prime number theorem, namely, that pi(x) = li(x)+O(x^(1/2+epsilon))", see Nathanson, page 323.

References

  • Melvyn B. Nathanson, Elementary Methods in Number Theory, Springer, 2000

Crossrefs

Programs

  • Magma
    [Floor(LogIntegral(n) - #PrimesUpTo(n)): n in [2..110]]; // G. C. Greubel, May 17 2019
    
  • Maple
    a:= n-> floor(evalf(Li(n)))-numtheory[pi](n):
    seq(a(n), n=2..120);  # Alois P. Heinz, Feb 23 2017
  • Mathematica
    iend = 100;
    For[x = 1, x <= iend, x++,
    a[x] = N[LogIntegral[x] - PrimePi[x]]]; t =
    Table[Floor[a[i]], {i, 2, iend}]; Print[t]
    Table[Floor[LogIntegral[n] - PrimePi[n]], {n, 2, 110}] (* G. C. Greubel, May 17 2019 *)
  • PARI
    vector(110, n, n++; floor(real(-eint1(-log(n))) - primepi(n)) ) \\ G. C. Greubel, May 17 2019
    
  • Sage
    [floor(li(n) - prime_pi(n)) for n in (2..110)] # G. C. Greubel, May 17 2019

Formula

a(n) = A047783(n) - A000720(n).

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

A053619 a(n) = round(n/(log(n)-1) - pi(n)).

Original entry on oeis.org

-1, -8, 28, 8, 5, 5, 3, 3, 4, 4, 3, 3, 2, 3, 3, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 2, 2, 1
Offset: 1

Views

Author

Henry Bottomley, Mar 21 2000

Keywords

Crossrefs

Programs

  • Magma
    [Round(n/(Log(n)-1) - #PrimesUpTo(n)): n in [1..110]]; // G. C. Greubel, May 16 2019
    
  • Mathematica
    Table[Round[n/(Log[n] -1) -PrimePi[n]], {n, 1, 110}] (* G. C. Greubel, May 16 2019 *)
  • PARI
    {a(n) = round(n/(log(n)-1) - primepi(n))}; \\ G. C. Greubel, May 16 2019
    
  • Sage
    [round(n/(log(n)-1) - prime_pi(n)) for n in (1..110)] # G. C. Greubel, May 16 2019

Extensions

More terms from James Sellers, Mar 23 2000
Showing 1-10 of 11 results. Next