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

A006879 Number of primes with n digits.

Original entry on oeis.org

0, 4, 21, 143, 1061, 8363, 68906, 586081, 5096876, 45086079, 404204977, 3663002302, 33489857205, 308457624821, 2858876213963, 26639628671867, 249393770611256, 2344318816620308, 22116397130086627, 209317712988603747, 1986761935284574233, 18906449883457813088, 180340017203297174362
Offset: 0

Views

Author

Keywords

Comments

The number of primes between 10^(n-1) and 10^n. - Cino Hilliard, May 31 2008 [Corrected by Jon E. Schoenfield, Nov 29 2008]

Examples

			As 2, 3, 5, and 7 are the only primes less than 10, a(1) = 4.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 21, pp 8, Ellipses, Paris 2008.
  • C. T. Long, Elementary Introduction to Number Theory. Prentice-Hall, Englewood Cliffs, NJ, 1987, p. 77.
  • P. Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 179.
  • D. Shanks, Solved and Unsolved Problems in Number Theory. Chelsea, NY, 2nd edition, 1978, p. 15.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.

Crossrefs

First differences of A006880.
Cf. A309329.

Programs

Formula

a(n) = pi(10^n)-pi(10^(n-1)) where pi(10^(-1)) := 0 (cf. A000720 and A006880).
Limit_{n->oo} a(n)/a(n-1) = 10. - Stefano Spezia, Aug 31 2025

Extensions

a(11) and a(12) corrected by Jud McCranie and Enoch Haga
a(19) corrected and a(20) added by Paul Zimmermann
a(21)-a(22) from Vladeta Jovovic, Nov 07 2001

A309359 Median of the primes p with 2^(n-1) < p < 2^n.

Original entry on oeis.org

6, 12, 23, 47, 97, 191, 383, 761, 1523, 3049, 6107, 12252, 24376, 48877, 97777, 195659, 391623, 783257, 1566386, 3133974, 6269116, 12538053, 25082361, 50170976, 100353498, 200730129, 401498897, 803081460, 1606292647, 3212862108
Offset: 3

Views

Author

Hugo Pfoertner, Jul 25 2019

Keywords

Comments

For n >= 3, median of the primes with n binary digits. The median of an even number of values is assumed to be defined as the arithmetic mean of the two central elements in their sorted list. The special case of the primes with two binary digits {2, 3} is excluded, because their median would be 5/2.

Examples

			a(3) = 6: 2^2 < {5, 7} < 2^3, (5 + 7)/2 = 6.
a(4) = 12: 2^3 < {11, 13} < 2^4, (11 + 13)/2 = 12
a(5) = 23: 2^4 < {17, 19, 23, 29, 31} < 2^5, median = 23.
		

Crossrefs

A131043 Number of primes between 10^n and 10^n+10^(n-1).

Original entry on oeis.org

1, 4, 16, 106, 861, 7216, 61938, 541854, 4814936, 43336106, 394050419, 3612791400, 33353349498, 309745405634, 2891246183239, 27107799609004, 255151905596682, 2409933230413924, 22832347500212719, 216919281298152512, 2066001163137387739, 19721816247905813257
Offset: 1

Views

Author

Cino Hilliard, Sep 23 2007

Keywords

Comments

The PARI script is good up to n=9. The last 3 terms were computed by the gcc 4.1.2 program in the link. A good approximation for the n-th term is R(10^n+10^(n-1))-R(10^n) where R(x) is Riemann's approximation of the number of prime numbers < x. This is included in the PARI script. for example, Rpr11(12) = 3612792548.5108.., accurate for the first 6 digits.

Examples

			For n=2, the 4 primes in the range 100 to 110 are 101,103,107,109. So 4 is the second entry in the sequence.
		

Crossrefs

Programs

  • PARI
    /*Some functions*/ pr11(n) = primepi(10^n+10^(n-1))-primepi(10^n) Rpr11(n) = R(10^n+10^(n-1))-R(10^(n)) R(x) = local(j); (sum(j=1,400,moebius(j)*Li(x^(1/j))/j)) /*End functions*/ for(x=1,9,print1(pr11(x),","))

Extensions

a(13)-a(19) from Hugo Pfoertner, Nov 16 2019
a(20)-a(21) from Chai Wah Wu, Nov 29 2019
a(22) from Chai Wah Wu, Nov 30 2019

A328032 If there are m primes between 10^(n-1) and 10^n, a(n) is the middle prime if m is odd, otherwise the larger of the two middle primes.

Original entry on oeis.org

5, 47, 509, 5273, 53047, 532907, 5356259, 53765519, 539119753, 5402600081, 54118210441, 541947386821, 5425907665571, 54313871643797, 543611236251491, 5440228524355381, 54438462600610513, 544705097744731559, 5449909581264135103
Offset: 1

Views

Author

Robert G. Wilson v, Oct 02 2019

Keywords

Comments

This sequence, unlike A309329, only contains primes.
For n > 2, a(n) > 10*a(n-1) for the terms shown. Does this continue?
The prime index of a(n): 3, 15, 97, 699, 5411, 44046, 371539, 3213018, 28304495, 252950023, 2286553663, 20862983416, 191836724429, 1775503643821, 16524756086736, 154541455728298, 1451397749344080, 13681755722697547, 129398810782042734, 1227438634918631724, 11674044544289825385, 111297278087667319110, 1063393839148059937607, 10180460079478002418395, 97640954583246485139774, 938046530135790455369642, 9025853588857058793877502, ..., .

Examples

			a(1) is 5 since, among the single-digit primes, i.e., {2, 3, 5, 7}, the two middle primes are {3, 5}, of which the larger one is 5;
a(2) is 47 since it is the middle prime of the two-digit primes, i.e., {11, 13, 17, ..., 47, ..., 83, 89, 97};
a(3) is 509 since it is the middle prime of the three-digit primes, i.e., {101, 103, 107, ..., 509, ..., 983, 991, 997}.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = PrimePi[ 10^(n -1)], q = PrimePi[ 10^n]}, Prime[ Ceiling[(q +p +1)/2]]]; Array[f, 13]

Formula

a(n) is the next prime after A309329(n) - 1.

A387500 Median of twin prime pairs with n decimal digits.

Original entry on oeis.org

5, 36, 420, 4644, 51060, 518238, 5206320, 52565169, 528113445, 5302625562
Offset: 1

Views

Author

Hugo Pfoertner, Sep 02 2025

Keywords

Comments

It is assumed that a pair of twin primes is characterized by its mean. The median of an even number of values is taken as the arithmetic mean of the two central elements in their sorted list.

Examples

			a(1): 2 pairs {3,5}, {5,7}, median = mean of {4,6} = 5;
a(2): 6 pairs {11,13}, {17,19}, {29,31}, {41,43}, {59,61}, {71,73}, median = mean of {30,42} = 36.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{s={},p=NextPrime[10^(n-1)]},While[p<10^n-4,If[PrimeQ[p+2],AppendTo[s,p+1]];p=NextPrime[p]];Median[s]];Array[a,7] (* James C. McMahon, Sep 02 2025 *)
Showing 1-5 of 5 results.