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

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

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

Original entry on oeis.org

4, 28, 175, 1244, 9628, 78625, 664916, 5762207, 50849233, 455055612, 4118066398, 37607950279, 346065645808, 3204942065690, 29844571475285, 279238344248555, 2623557165610820, 24739954309690413, 234057667376222380, 2220819602783663481
Offset: 1

Views

Author

Vladimir Pletser, Mar 16 2013

Keywords

Crossrefs

Programs

  • Maple
    seq(round(evalf(integrate(1/log(t), t=3..10^n))), n=1..1000);
  • Mathematica
    Table[Round[LogIntegral[10^n]-LogIntegral[3]],{n,30}] (* Harvey P. Dale, Aug 24 2022 *)

Formula

a(n) = round(Li( 10^n)-Li(3)).

A058289 Integer nearest 10^n/(log(10^n) - 1.08366).

Original entry on oeis.org

-1, 8, 28, 172, 1231, 9588, 78543, 665140, 5768004, 50917519, 455743004, 4124599869, 37668527415, 346621096885, 3210012022164, 29890794226982, 279660033612131, 2627410589445923, 24775244142175635, 234381646366460804
Offset: 0

Views

Author

Robert G. Wilson v, Dec 07 2000

Keywords

Comments

"Adrien-Marie Legendre in 1778 published his work 'Essai sur la théorie des nombres' where he proposed a modified form of the first approximation, pi(n) ~ n/ln n." (Gullberg)

References

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

Crossrefs

Programs

  • Mathematica
    Table[ Round[ 10^n /(Log[10^n] - 1.08366) ], {n, 0, 22} ]
  • PARI
    { default(realprecision, 1000); t=log(10); for (n=0, 500, write("b058289.txt", n, " ", round(10^n/(n*t - 1.08366))); ); } \\ Harry J. Smith, Jun 22 2009

Extensions

Corrected some terms. - Harry J. Smith, Jun 22 2009

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

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

A226945 Integer nearest f(10^n), where f(x) = Sum of ( mu(k) * H(k)/k^(3/2) * Integral Log(x^(1/k)) ) for k = 1 to infinity, where H(k) is the harmonic number sum_{i=1..k} 1/i.

Original entry on oeis.org

4, 25, 168, 1226, 9585, 78521, 664652, 5761512, 50847348, 455050385, 4118051652, 37607908133, 346065524108, 3204941711340, 29844570436484, 279238341185832, 2623557156537070, 24739954282695698, 234057667295619287, 2220819602542218793
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 31 2013

Keywords

Comments

The sequence gives exactly the values of pi(10^n) for n = 1 to 3.
A228724 gives the difference between A006880 and this sequence.

Crossrefs

Programs

  • Mathematica
    f[n_Integer] := Sum[N[MoebiusMu[k]*HarmonicNumber[k]/k^(3/2)*LogIntegral[n^(1/k)], 50], {k, 5!}]; Table[Round[f[10^n]], {n, 20}]

A089896 Logarithmic integral approximation to number of primes less than 10^x.

Original entry on oeis.org

6, 30, 177, 1246, 9629, 78627, 664918, 5762209, 50849234, 455055614, 4118066400, 37607950280, 346065645810, 3204942065691, 29844571475287, 279238344248556, 2623557165610821, 24739954309690415, 234057667376222382
Offset: 1

Views

Author

Cino Hilliard, Jan 10 2004

Keywords

Comments

In computing Li(x) we can limit the iterations to 2*log(x) + m where m is suitably large to allow convergence to the precision desired. If we let m = floor(log(log(x))) we get a better approximation of Pi(x) than the full Li(x) expansion. With this m we get Li(x) < Pi(x) often but still closer in absolute value to Pi(x). Note the use of the gamma function to quickly compute factorials in the precision range i.e. gamma(x+1) = x!.
See A057754 for the round() variant. [From R. J. Mathar, Oct 09 2010]

Programs

  • Mathematica
    Table[Floor[LogIntegral[10^n]], {n, 19}] (* Arkadiusz Wesolowski, Dec 23 2011 *)
  • PARI
    Li(n,m) = { y2 = log(n); y = 1; z=1; s=log(y2)+ Euler(); for(x=1,floor(2*log(n)+m),y=y2^x/x/gamma(x+1); s+=y; ); return(s) }
    pw2pix(n,m) = { for(x=1,n, y=10^x; print1(floor(Li(y,m))",") ) }

Formula

The logarithmic Integral can be computed by Li(x) = log(log(x)) + log(x) + log(x)^2/2/2! + log(x)^3/3/3! + ... + 1 - log(3/2) - sum(k=1, prec, (zeta(2k+1)-1)/(2k+1)/4^k). This last expression is a fast converging series taken from the link for the Euler-Mascheroni constant 0.57721.. where prec is the precision level you are using. PARI has an Euler() function built in so that was used in this calculation.

A163516 a(n) = floor( Sum_{x=2..n} x/log(x) ).

Original entry on oeis.org

0, 2, 5, 8, 11, 14, 18, 22, 26, 30, 35, 40, 45, 50, 56, 61, 67, 74, 80, 87, 94, 101, 108, 116, 123, 131, 140, 148, 157, 165, 175, 184, 193, 203, 213, 223, 233, 243, 254, 265, 276, 287, 299, 310, 322, 334, 346, 359, 371, 384, 397, 410, 424, 437, 451, 465, 479, 493
Offset: 1

Views

Author

Cino Hilliard, Jul 30 2009

Keywords

Comments

a(n) closely approximates the number of primes < n^2, that is, A038107(n) = Pi(n^2).
In fact, the sum is as good as Li(n^2). For n = 10^9,
a(n) = 24739954333817884.
Pi(n^2) = 24739954287740860 = A006880(18).
Li(n^2) = 24739954309690415 = A057754(18) = A089896(18).
R(n^2) = 24739954284239494 = A057793(18).
Now x/(log(x)-1) is a much better approximation of Pi(x) than x/log(x).
10^18/(log(10^18)-1) = 24723998785919976 and
10^18/log(10^18) = 24127471216847323.
Ironically though, a(n) = Sum_{x=2..n} x/(log(x)-1) is far from Pi(n^2), see A058290.

Examples

			For n = 10, floor(Sum_{x=2..n} x/log(x)) = 30, the 10th term.
		

Programs

  • Mathematica
    Table[Floor[Sum[j/Log[j], {j, 2, n}]], {n,1,50}] (* G. C. Greubel, Jul 27 2017 *)
    Join[{0},Floor[Accumulate[Table[x/Log[x],{x,2,60}]]]] (* Harvey P. Dale, May 22 2021 *)
  • PARI
    nthsum(n) = for(j=1,n,print1(floor(sum(x=2,j,x/log(x)))","));

Formula

a(10^n) = A163521(n).

Extensions

Offset corrected, definition detailed, 7 references to other sequences added by R. J. Mathar, Aug 29 2009
Showing 1-8 of 8 results.