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
As 2, 3, 5, and 7 are the only primes less than 10, a(1) = 4.
- 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.
- Jianing Song, Table of n, a(n) for n = 0..29 (terms 0..24 by Charles R Greathouse IV, a(25) by Vladimir Pletser, a(26)-a(28) from David Baugh, a(29) based on A006880)
- C. K. Caldwell, How Many Primes Are There?
- Vladimir Pletser, Global Generalized Mersenne Numbers: Definition, Decomposition, and Generalized Theorems, Preprints.org, 2024. See p. 20.
- Index entries for sequences related to numbers of primes in various ranges.
A006988
a(n) = (10^n)-th prime.
Original entry on oeis.org
2, 29, 541, 7919, 104729, 1299709, 15485863, 179424673, 2038074743, 22801763489, 252097800623, 2760727302517, 29996224275833, 323780508946331, 3475385758524527, 37124508045065437, 394906913903735329, 4185296581467695669, 44211790234832169331
Offset: 0
a(0) = 10^0-th prime = first prime = 2.
- R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 111.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Marc Deleglise et al., Table of n, a(n) for n = 0..24 (a(23) corrected and a(24) added using Kim Walisch's primecount program, by David Baugh, Nov 11 2015)
- C. K. Caldwell, Marc Deleglise's work on new values of pi(x)
- UTM, The Nth Prime Page.
- Eric Weisstein's World of Mathematics, Prime Number
- R. G. Wilson, V, Letter to N. J. A. Sloane, Jan. 1989
A091634
Number of primes less than 10^n which do not contain the digit 0.
Original entry on oeis.org
4, 25, 153, 1010, 7122, 52313, 397866, 3103348, 24649318, 198536215, 1616808581, 13287264748, 110033428309, 917072930187
Offset: 1
a(3) = 153 because there are 168 primes less than 10^3, 15 primes have at least one zero; 168 - 15 = 153.
-
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 0] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
Table[PrimePi[10^n]-Total[Boole[DigitCount[#,10,0]>0]&/@ Prime[ Range[ PrimePi[ 10^n]]]],{n,8}] (* The program generates the first 8 terms of the sequence. To generate more, increase the digit 8 but the program may take a long time to run. *) (* Harvey P. Dale, Aug 26 2021 *)
-
from sympy import sieve # use primerange for larger terms
def nodigs0(n): return '0' not in str(n)
def aupton(terms):
ps, alst = 0, []
for n in range(1, terms+1):
ps += sum(nodigs0(p) for p in sieve.primerange(10**(n-1), 10**n))
alst.append(ps)
return alst
print(aupton(7)) # Michael S. Branicky, Apr 25 2021
A091643
Number of primes less than 10^n which do not contain the digit 9.
Original entry on oeis.org
4, 19, 108, 687, 4766, 35139, 267486, 2083814, 16531372, 133059504, 1082995490, 8896945667, 73651718719, 613664827254
Offset: 1
a(2) = 19 because of the 25 primes less than 10^2, 6 have at least one digit 9; 25-6 = 19.
-
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 9] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
A073517
Number of primes less than 10^n with initial digit 1.
Original entry on oeis.org
0, 4, 25, 160, 1193, 9585, 80020, 686048, 6003530, 53378283, 480532488, 4369582734, 40063566855, 369893939287, 3435376839800, 32069022099022, 300694113015105, 2830466318006780, 26735673312004455, 253315661161665338, 2406763761677705769, 22923886160712831134, 218839439542390117580
Offset: 1
a(2)=4 because there are 4 primes up to 10^2 whose initial digit is 1 (11, 13, 17 and 19).
For primes with initial digit d (1 <= d <= 9) see
A045707,
A045708,
A045709,
A045710,
A045711,
A045712,
A045713,
A045714,
A045715;
A073517,
A073516,
A073515,
A073514,
A073513,
A073512,
A073511,
A073510,
A073509.
-
f[n_] := f[n] = PrimePi[2*10^n] - PrimePi[10^n] + f[n - 1]; f[0] = 0; Table[ f[n], {n, 0, 13}]
-
a(n,d=1)=sum(k=0, n-1, primepi((d+1)*10^k-1) - primepi(d*10^k-1)) \\ Andrew Howroyd, Dec 15 2024
A073509
Number of primes less than 10^n with initial digit 9.
Original entry on oeis.org
0, 1, 15, 127, 1006, 8230, 70320, 614821, 5453140, 48982456, 444608278, 4070532710, 37535715441, 348245215460, 3247889171908, 30429496751905, 286235215995588, 2702000272361599, 25586688305447928, 242978340446949438, 2313264023790027111, 22074118786158858975
Offset: 1
a(2) = 1 because there is 1 prime less than 100 whose initial digit is 9, i.e., 97.
For primes with initial digit d (1 <= d <= 9) see
A045707,
A045708,
A045709,
A045710,
A045711,
A045712,
A045713,
A045714,
A045715;
A073517,
A073516,
A073515,
A073514,
A073513,
A073512,
A073511,
A073510,
A073509
A073510
Number of primes less than 10^n with initial digit 8.
Original entry on oeis.org
0, 2, 17, 127, 1003, 8326, 71038, 618610, 5481646, 49221187, 446590932, 4087194991, 37677478288, 349465615584, 3258501713644, 30522628848972, 287059041039078, 2709339704446862, 25652489700275636, 243571629996128384, 2318640708958531064, 22123070798400775157
Offset: 1
a(2)=2 because there are 2 primes up to 10^2 whose initial digit is 8 (namely 83 and 89).
For primes with initial digit d (1 <= d <= 9) see
A045707,
A045708,
A045709,
A045710,
A045711,
A045712,
A045713,
A045714,
A045715;
A073517,
A073516,
A073515,
A073514,
A073513,
A073512,
A073511,
A073510,
A073509
A073511
Number of primes less than 10^n with initial digit 7.
Original entry on oeis.org
1, 4, 18, 125, 1027, 8435, 71564, 622882, 5516130, 49495432, 448855139, 4106164356, 37838546363, 350849788546, 3270531245684, 30628143485953, 287992070079777, 2717649138419586, 25726964404879666, 244242934202964444, 2324722877951987037, 22178433287546997612
Offset: 1
a(2)=4 because there are 4 primes up to 10^2 whose initial digit is 7 (namely 7, 71, 73 and 79).
For primes with initial digit d (1 <= d <= 9) see
A045707,
A045708,
A045709,
A045710,
A045711,
A045712,
A045713,
A045714,
A045715;
A073517,
A073516,
A073515,
A073514,
A073513,
A073512,
A073511,
A073510,
A073509
A073512
Number of primes less than 10^n with initial digit 6.
Original entry on oeis.org
0, 2, 18, 135, 1013, 8458, 72257, 628206, 5556434, 49815418, 451476802, 4128049326, 38024311091, 352446754137, 3284400373590, 30749731897370, 289066731934716, 2727216210298152, 25812680778645432, 245015325044029789, 2331718909954888809, 22242097596092999144
Offset: 1
a(2)=2 because there are 2 primes up to 10^2 whose initial digit is 2 (namely 61 and 67).
For primes with initial digit d (1 <= d <= 9) see
A045707,
A045708,
A045709,
A045710,
A045711,
A045712,
A045713,
A045714,
A045715;
A073517,
A073516,
A073515,
A073514,
A073513,
A073512,
A073511,
A073510,
A073509
A073513
Number of primes less than 10^n with initial digit 5.
Original entry on oeis.org
1, 3, 17, 131, 1055, 8615, 72951, 633932, 5602768, 50193913, 454577490, 4153943134, 38243708524, 354330372215, 3300752009165, 30892997367352, 290332329192655, 2738477783884855, 25913537508233527, 245923809778144431, 2339944887042508496, 22316931815316988517
Offset: 1
a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 5 (namely 5, 53 and 59).
For primes with initial digit d (1 <= d <= 9) see
A045707,
A045708,
A045709,
A045710,
A045711,
A045712,
A045713,
A045714,
A045715;
A073517,
A073516,
A073515,
A073514,
A073513,
A073512,
A073511,
A073510,
A073509
Comments