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

A069284 Decimal expansion of li(2) = gamma + log(log(2)) + Sum_{k>=1} log(2)^k / ( k*k! ).

Original entry on oeis.org

1, 0, 4, 5, 1, 6, 3, 7, 8, 0, 1, 1, 7, 4, 9, 2, 7, 8, 4, 8, 4, 4, 5, 8, 8, 8, 8, 9, 1, 9, 4, 6, 1, 3, 1, 3, 6, 5, 2, 2, 6, 1, 5, 5, 7, 8, 1, 5, 1, 2, 0, 1, 5, 7, 5, 8, 3, 2, 9, 0, 9, 1, 4, 4, 0, 7, 5, 0, 1, 3, 2, 0, 5, 2, 1, 0, 3, 5, 9, 5, 3, 0, 1, 7, 2, 7, 1, 7, 4, 0, 5, 6, 2, 6, 3, 8, 3, 3, 5, 6, 3, 0, 6, 0, 2
Offset: 1

Views

Author

Frank Ellermann, Mar 13 2002

Keywords

Comments

From Mats Granvik, Jun 14 2013: (Start)
The logarithmic integral li(x) = exponential integral Ei(log(x)).
The generating function for tau A000005, the number of divisors of n is: Sum_{n >= 1} a(n) x^n = Sum_{k > 0} x^k/(1 - x^k). Another way to write the generating function for tau A000005 is Sum_{n>=1} A000005(n) x^n = Sum_{a=1..Infinity} Sum_{b>=1} x^(a*b).
If we instead think of the integral with the same form, evaluate at x = exp(1) = 2.7182818284... = A001113 and set the integration limits to zero and sqrt(log(n)), we get for n >= 0:
Logarithmic integral li(n) = Integral_{a = 0..sqrt(log(n))} Integral_{b=0..sqrt(log(n))} exp(1)^(a*b) + EulerGamma + log(log(n)). (End)
li(2)-1 is the minimum [known to date, for n>1] of |li(n) - PrimePi(n)|. - Jean-François Alcover, Jul 10 2013
The modern logarithmic integral function li(x) = Integral_{t=0..x} (1/log(t)) replaced the Li(x) = Integral_{t=2..x} (1/log(t)) which was sometimes used because it avoids the singularity at x=1. This constant is the offset between the two functions: li(2) = li(x) - Li(x) = Integral_{t=0..2} (1/log(t)). - Stanislav Sykora, May 09 2015

Examples

			1.0451637801174927848445888891946131365226155781512015758329...
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, p. 425.

Crossrefs

Cf. A069285 (continued fraction), A057754, A057794, A060851.
Euler's constant gamma: A001620, log(2): A002162, k*k!: A001563.

Programs

Extensions

Replaced several occurrences of "Li" with "li" in order to enforce current conventions. - Stanislav Sykora, May 09 2015

A215663 Floor(R(10^n)) - pi(10^n), where pi(x) is the number of primes <= x, R(x) = Sum_{ k>=1 } ((mu(k)/k) * li(x^(1/k))) and li(x) is the Cauchy principal value of the integral from 0 to x of dt/log(t).

Original entry on oeis.org

0, 0, 0, -3, -5, 29, 88, 96, -79, -1828, -2319, -1476, -5774, -19201, 73217, 327052, -598255, -3501366, 23884333, -4891825, -86432205, -127132665, 1033299853, -1658989720, -1834784715, -17149335456, -17535487935, -174760519828
Offset: 1

Views

Author

Vladimir Pletser, Mar 09 2013

Keywords

Comments

In Riemann's approximation for the number of primes <= 10^n, taking Floor(R(10^n)), i.e. the greatest integer <= R(10^n), instead of the nearest integer to R(10^n), i.e. Round(R(10^n)) (see A057794), provides a better approximation to pi(10^n) for small values of n and some other values of n, i.e. Abs(a(n)) = Abs(A057794(n))-1 for n = 1, 2, 8, 15. However, the approximation is worse by one unit, i.e. Abs(a(n)) = Abs(A057794(n))+1 for n = 4, 11, 13, 14, 21, 24, 25, 27, 28. The approximation is the same for the other 15 values of n <= 28. However, it yields a better average relative difference, i.e. Average(Abs(a(n))/pi(10^n)) = 1.24535…x10^-4 for 1 <= n <= 28, compared to Average(Abs(A057794(n))/pi(10^n)) = 1.04526…x10^-2. - Corrected and extended by Eduard Roure Perdices, Apr 16 2021

References

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

Crossrefs

Programs

  • Mathematica
    R[x_] := Sum[N[LogIntegral[x^(1/k)]*MoebiusMu[k]/k, 36], {k, 1, 1000}]; a[n_] := Floor[R[10^n]-PrimePi[10^n]]
    a[n_] := Floor[RiemannR[10^n] - PrimePi[10^n]] (* Eduard Roure Perdices, Apr 16 2021 *)

Extensions

a(17) corrected, a(25)-a(28) obtained using A006880. - Eduard Roure Perdices, Apr 16 2021

A058290 Rounded difference between 10^n/(log(10^n) - A) and pi(10^n), where A is Legendre's constant and pi is the prime counting function.

Original entry on oeis.org

-1, 4, 3, 4, 2, -4, 45, 561, 6549, 69985, 690493, 6545056, 60615397, 555560046, 5070271362, 46223804313, 421692578206, 3853431791690, 35289854434775, 323979090116197, 2981921009910364, 27516571651291205, 254562416350667928
Offset: 0

Views

Author

Robert G. Wilson v, Dec 07 2000

Keywords

Comments

Legendre's constant is 1.08366 (A228211). - Alonso del Arte, Nov 02 2013
This sequence has historical rather than mathematical interest, cf. A228211. It is better to use 1 + 1/log(10^n) instead of A. Since A is given to only 5 decimal places, it does not make much sense to compute terms of this sequence beyond n ~ 10. For n = 9, the error a(9)/A006880(9) is about 0.14%, while the error for 1 + 1/log(10^9) instead of A is only about 0.04%. - M. F. Hasler, Dec 03 2018

References

  • Jan Gullberg, "Mathematics, From the Birth of Numbers", W. W. Norton and Company, NY and London, 1997, page 81.

Crossrefs

Programs

  • Mathematica
    Table[ Round[ 10^n /(Log[10^n] - 1.08366) - PrimePi[10^n] ], {n, 0, 13} ]
  • PARI
    {A006880_vec = [0, 4, 25, 168, 1229, 9592, 78498, 664579, 5761455, 50847534, 455052511 4118054813, 37607912018, 346065536839, 3204941750802, 29844570422669, 279238341033925, 2623557157654233, 24739954287740860, 234057667276344607, 2220819602560918840, 21127269486018731928, 201467286689315906290, 1925320391606803968923]} \\ Edited by M. F. Hasler, Dec 03 2018
    {default(realprecision, 100); t=log(10); for (n=0, 23, write("b058290.txt", n, " ", round(10^n/(n*t - 1.08366)) - A006880_vec[n+1]))} \\ Harry J. Smith, Jun 22 2009
    
  • PARI
    A058290(n)={10^n\/(n*log(10)-1.08366)-A006880(n)} \\ with A006880(n)=primepi(10^n) and/or precomputed values for n > 10. - M. F. Hasler, Dec 03 2018

Formula

a(n) = round(10^n/(log(10^n) - 1.08366)) - A006880(n). - M. F. Hasler, Dec 03 2018

Extensions

More terms from Harry J. Smith, Jun 22 2009

A216709 a(n) is the integer closest to Riemann's prime counting function R(n*10^6) minus the prime counting function pi(n*10^6).

Original entry on oeis.org

29, -9, 0, 33, -64, 24, -38, -6, -53, 88, -3, -46, -51, 25, 34, 1, -18, -117, -46, -36, 18, -77, 27, 39, 3, 33, -6, 2, 7, -41, -139, -61, -104, -108, 106, 135, 198, 190, 3, -84, -102, 38, 50, 52, 55, -131, -134, -16, 99, -67, -53, -90, -49, -9, 127, 72, -13, 50, -17, 39, -85, 114
Offset: 1

Views

Author

Jean-François Alcover, Sep 17 2012

Keywords

Comments

H. M. Edwards gives a(1)=30 instead of 29; he may have considered 1 a prime.

References

  • H. M. Edwards, Riemann's Zeta Function, Dover Publications, New York, 1974 (ISBN 978-0-486-41740-0), page 35.

Crossrefs

Cf. A057794.

Programs

  • Mathematica
    Table[ Round[ RiemannR[n*10^6] - PrimePi[n*10^6]], {n, 1, 40}]

Extensions

Corrected and extended by Vincenzo Librandi, Jul 19 2013

A225138 Difference between pi(10^n) and nearest integer to (4*((S(n))^(n-1))) where pi(10^n) = number of primes <= 10^n (A006880) and S(n) = Sum_{i=0..2} (C(i)*(log(log(A*(B+n^(8/3)))))^(2i)) (A225137).

Original entry on oeis.org

0, 0, 0, 1, 0, -31, -35, 193, 0, -13318, -153006, -828603, 957634, 86210559, 1293461717, 13497122460, 107995231864, 586760026575, -1942949, -54073500144915, -897247302459084, -9393904607181950, -54876701507521387, 379565456321952448
Offset: 1

Views

Author

Vladimir Pletser, Apr 29 2013

Keywords

Comments

A225137 provides exactly the values of pi(10^n) for n = 1, 2, 3, 5 and 9 and yields an average relative difference in absolute value, i.e., average(abs(A225138(n))/pi(10^n)) = 7.2165...*10^-5 for 1 <= n <= 24.
A225137 provides a better approximation to the distribution of pi(10^n) than: (1) the Riemann function R(10^n), whether as the sequence of integers <= R(10^n) (A215663), which yields 1.453...*10^-4, or as the sequence of integers nearest to R(10^n) (A057794), which yields 0.01219...; (2) the functions of the logarithmic integral Li(x) = Integral_{t=0..x} dt/log(t), whether as the sequence of integers nearest to (Li(10^n) - Li(3)) (A223166), which yields 7.4969...x10^-3 (see A223167), or as Gauss's approximation to pi(10^n), i.e., the sequence of integers nearest to (Li(10^n) - Li(2)) (A190802) = 0.020116... (see A106313), or as the sequence of integers nearest to Li(10^n) (A057752), which yields 0.032486....

References

  • Jonathan Borwein, David H. Bailey, Mathematics by Experiment, A. K. Peters, 2004, p. 65 (Table 2.2).
  • 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) - A225137(n).

A227694 Difference between pi(10^n) and nearest integer to (F[2n+1](S(n)))^2 where pi(10^n) = number of primes <= 10^n (A006880), F[2n+1](x) are Fibonacci polynomials of odd indices [2n+1] and S(n) = Sum_{i=0..2} (C(i)*(log(log(A*(B+n^2))))^(2i)) (see A227693).

Original entry on oeis.org

0, 0, 0, 0, -3, -29, 171, 2325, 13809, 33409, -443988, -8663889, -99916944, -927360109, -7318034084, -47993181878, -223530657736, 810207694, 16558446000251, 257071298610935, 2657469557986545, 18804132783879606, 24113768300809752, -2232929440358147845, -54971510676262602742
Offset: 1

Views

Author

Vladimir Pletser, Jul 19 2013

Keywords

Comments

A227693 provides exactly the values of pi(10^n) for n = 1 to 4 and yields an average relative difference in absolute value, average(abs(A227694(n))/pi(10^n)) = 1.58269...*10^-4 for 1 <= n <= 25.
A227693 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) (A057794), which yields 0.01219...; (2) the functions of the logarithmic integral Li(x) = Integral_{t=0..x} dt/log(t), whether as the sequence of integers nearest to (Li(10^n) - Li(3)) (A223166), which yields 0.0074969... (see A223167), or as Gauss's approximation to pi(10^n), i.e., the sequence of integers nearest to (Li(10^n) - Li(2)) (A190802), which yields 0.020116... (see A106313), or as the sequence of integer nearest to Li(10^n) (A057752), which yields 0.032486....

References

  • Jonathan Borwein, David H. Bailey, Mathematics by Experiment, A. K. Peters, 2004, p. 65 (Table 2.2).
  • 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) - A227693(n).

A228724 Difference between pi(10^n) and A226945(n), where pi(x) is the number of primes <= x.

Original entry on oeis.org

0, 0, 0, 3, 7, -23, -73, -57, 186, 2126, 3161, 3885, 12731, 39462, -13815, -151907, 1117163, 5045162, -19274680, 18700047, 127912738, 252060543, -656184524, 2799754423, 5292148929, 27646015077, 49454963317, 271968742992
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 31 2013

Keywords

Crossrefs

Formula

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

Extensions

a(25)-a(26) added by David Baugh, Mar 17 2015
a(27)-a(28) added using A006880 and A226945, by Eduard Roure Perdices, Apr 16 2021

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).

A226473 a(n) is the first prime index where the gap between R(n), Riemann's prime counting function, and Pi(n), the exact prime counting function, is greater than n.

Original entry on oeis.org

109, 556, 1327, 3296, 5380, 10343, 11767, 19202, 19361, 19371, 24121, 42863, 58243, 59453, 59473, 152959, 155809, 155863, 155893, 175594, 175618, 230393, 298545, 298557, 298974, 298986, 299277, 300072, 300135, 302547, 355093, 355111, 463171, 909917, 910219, 993762
Offset: 1

Views

Author

Jean-François Alcover, Sep 17 2012

Keywords

Examples

			RiemannR(109) = 27.4664... and PrimePi(109) = 29 give the first gap greater than 1, hence a(1) = 109.
		

References

  • H. M. Edwards, Riemann's Zeta Function, Dover Publications, New York, 1974 (ISBN 978-0-486-41740-0), page 35.

Crossrefs

Cf. A057794.

Programs

  • Mathematica
    Reap[For[n = 1; gap = 1, n < 10^6, n++, If[Abs[RiemannR[n] - PrimePi[n]] > gap, Print[{gap, n}]; Sow[n]; gap++]]][[2, 1]]
Showing 1-10 of 11 results. Next