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-9 of 9 results.

A045916 Erroneous version of A057752.

Original entry on oeis.org

86, 19, 20, 37, 127, 336, 748, 1691, 3088, 11761, 41524, 95388, 316706, 712386
Offset: 2

Views

Author

Keywords

References

  • C. Clawson, Mathematical Mysteries, Plenum Press, 1996, p. 158.

A057794 (Integer nearest 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

1, 1, 0, -2, -5, 29, 88, 97, -79, -1828, -2318, -1476, -5773, -19200, 73218, 327052, -598255, -3501366, 23884333, -4891825, -86432204, -127132665, 1033299853, -1658989719, -1834784714, -17149335456, -17535487934, -174760519827
Offset: 1

Views

Author

Robert G. Wilson v, Nov 04 2000

Keywords

Comments

This is Riemann's remarkable approximation for the number of primes <= x.
Equivalently, R(x) is given by the Gram series, 1 + sum of log(x)^k/(k*k!*zeta(k+1)) for k = 1 to infinity. This series converges more quickly.

References

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

Crossrefs

Programs

  • Mathematica
    R[x_] := Sum[N[LogIntegral[x^(1/k)]*MoebiusMu[k]/k, 36], {k, 1, 1000}]; a[n_] := Abs[Round[R[10^n]-PrimePi[10^n]]]
    gram[x_] := 1+Sum[N[Log[x]^k/(k*k!*Zeta[k+1]), 100], {k, 1, 1000}]; a[n_] := Abs[Round[gram[10^n]-PrimePi[10^n]]]
    (* From version 7 on : *) a[n_] := Round[RiemannR[10^n]-PrimePi[10^n]] (* Jean-François Alcover, Sep 17 2012 *)
  • PARI
    A057794=vector(#A006880,i,round(1+suminf(k=1, log(10^i)^k/(k*k!*zeta(k+1)))-A006880[i])) \\ - M. F. Hasler, Feb 26 2008

Extensions

First term corrected by David Baugh, Nov 15 2002
Signs added by M. F. Hasler, Feb 26 2008
The value of a(23) is not known at present, I believe. - N. J. A. Sloane, Mar 17 2008
Last two terms a(23) and a(24), with Pi(10^n) for n=23 and 24 from A006880, from Vladimir Pletser, Feb 27 2013
Terms a(25)-a(28) obtained using A006880. - Eduard Roure Perdices, Apr 13 2021

A106313 Differences between the prime-counting function and Gauss's approximation for number of primes < 10^n.

Original entry on oeis.org

1, 4, 9, 16, 37, 129, 338, 753, 1700, 3103, 11587, 38262, 108970, 314889, 1052618, 3214631, 7956588, 21949554, 99877774, 222744643, 597394253, 1932355207, 7250186215, 17146907277, 55160980938, 155891678120, 508666658005, 1427745660373, 4551193622463
Offset: 1

Views

Author

Gary W. Adamson, Apr 28 2005

Keywords

Comments

From Vladimir Pletser, Mar 16 2013: (Start)
As Li(2) = 1.04516..., a(n) = A057752(n) - 1.
This sequence gives the exact values of the difference between Gauss's Li (defined as integral(2..10^n, dt/log(t)) or Li(10^n)-Li(2)) and the number of primes <= 10^n (A006880). For large values of x=10^n, Li(2) can be neglected but for small values of x=10^n, the value of Li(2) cannot be neglected.
This sequence yields a better average relative difference, i.e., average(a(n)/pi(10^n)) = 2.0116...x10^-2 for 1<=n<=24, compared to average(A057752(n)/pi(10^n)) = 3.2486...x10^-2. However see also Li(10^n)-Li(3) in A223166 and A223167.
Note that most of the Tables in the literature giving the difference of Li(10^n) - pi(10^n) use the values of A057752 as the difference between Gauss's Li values and pi(10^n). This is incorrect and the values above should be used instead. For example (certainly not exhaustive):
- John H. Conway and R. K. Guy in "The Book of Numbers" show in Fig. 5.2, p. 144, Li(N) as integral(2..10^n, dt/log(t)) but reports values of A057752 (the difference of integral(0..10^n, dt/log(t)) and pi(10^n)) in Table 5.2, p. 146;
- Eric Weisstein in "Prime Counting Function" gives also values of -(A057752) for pi(10^n)-Li(10^n)
- Wikipedia gives a Table with Li(10^n)-pi(10^n) (A057752);
- C. K. Caldwell in Table 3 in the link below give values of Li(10^n) while values of Li(10^n) - Li(2) would be more suited. (End)

Examples

			Given x = 10^4, pi(x) = 1229, Gauss's approximation = 1245. Thus a(4) = 1245 - 1229 = 16.
		

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

Programs

  • Mathematica
    Table[Round[Integrate[1/Log[t],{t,2,10^n}]]-PrimePi[10^n],{n,27}] (* James C. McMahon, Feb 01 2024 *)

Formula

The prime counting function pi(x) runs through x = 10^1, 10^2, 10^3, ...; being subtracted from Gauss's approximation, integral(2, x)dt/log t.
a(n) = A190802(n) - A006880(n).

Extensions

a(23)-a(24) from Nathaniel Johnston, May 25 2011
a(25)-a(28), obtained using A006880, added by Eduard Roure Perdices, Apr 16 2021
a(29) (using A006880) from Alois P. Heinz, Feb 01 2024
Name clarified by James C. McMahon, Feb 02 2024

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

A223167 Difference between nearest integer to (Li(10^n)-Li(3)) and pi(10^n), where Li(10^n)-Li(3) = integral(3.. 10^n, dt/log(t)) (A223166) and pi(10^n) = number of primes <= 10^n (A006880).

Original entry on oeis.org

0, 3, 7, 15, 36, 127, 337, 752, 1699, 3101, 11585, 38261, 108969, 314888, 1052616, 3214630, 7956587, 21949553, 99877773, 222744641, 597394252, 1932355206, 7250186214, 17146907276, 55160980937, 155891678119, 508666658004, 1427745660372
Offset: 1

Views

Author

Vladimir Pletser, Mar 16 2013

Keywords

Comments

As Li(3)= 2.163588..., A057752(n)-a(n) = 2, except for n =3, 6, 10, 11, 15, 20 where A057752(n)-a(n)= 3.
This sequence yields an even better average relative difference than Gauss's approximation (A106313), i.e., Average(a(n)/pi(10^n)) = 7.4969...*10^-3 for 1<=n<=24, compared to Average(A057752(n)/pi(10^n)) = 3.2486...*10^-2 and Average(A106313(n)/pi(10^n)) = 2.0116...*10^-2, showing that, when using the logarithmic integral, Li(10^n)-Li(3) (A223166) gives a better approximation to pi(10^n) than Li(10^n)-Li(2) (A190802) and than Li(10^n) (A057754).

Crossrefs

Programs

  • Mathematica
    a[n_] := Round[LogIntegral[10^n] - LogIntegral[3]] - PrimePi[10^n]; Table[a[n], {n, 1, 14}]
  • PARI
    a(n)=round(eint1(-log(3))-eint1(-n*log(10)))-primepi(10^n) \\ Charles R Greathouse IV, May 03 2013

Formula

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

Extensions

Terms a(25)-a(28) obtained using A006880. - Eduard Roure Perdices, Apr 14 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

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

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).
Showing 1-9 of 9 results.