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.

Previous Showing 11-20 of 22 results. Next

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

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=4 because there are 4 primes up to 10^2 whose initial digit is 7 (namely 7, 71, 73 and 79).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
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

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[8*10^n] - PrimePi[7*10^n] + f[n - 1]; f[0] = 1; Table[ f[n], {n, 0, 12}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(20)-a(22) added by David Baugh, Mar 22 2015

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

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=2 because there are 2 primes up to 10^2 whose initial digit is 2 (namely 61 and 67).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
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

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[7*10^n] - PrimePi[6*10^n] + f[n - 1]; f[0] = 0; Table[ f[n], {n, 0, 12}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(20)-a(22) added by David Baugh, Mar 22 2015

A073514 Number of primes less than 10^n with initial digit 4.

Original entry on oeis.org

0, 3, 20, 139, 1069, 8747, 74114, 641594, 5661135, 50653546, 458352691, 4185483176, 38510936699, 356622729564, 3320632228693, 31067060521057, 291869049531878, 2752144407792176, 26035873192178041, 247025281876786013, 2349914303292170310, 22407593754131275705
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 4 (namely 41, 43 and 47).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
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

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[5*10^n] - PrimePi[4*10^n] + f[n - 1]; f[0] = 0; Table[ f[n], {n, 0, 13}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(20)-a(22) added by David Baugh, Mar 22 2015

A073515 Number of primes less than 10^n with initial digit 3.

Original entry on oeis.org

1, 3, 19, 139, 1097, 8960, 75290, 651085, 5735086, 51247361, 463196868, 4225763390, 38851672813, 359541975662, 3345924530873, 31288310624754, 293820812588401, 2769490109678920, 26191046215879444, 248421640738371325, 2362546444095790527, 22522418647770393663
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 3 (namely 3, 31 and 37).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
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

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[4*10^n] - PrimePi[3*10^n] + f[n - 1]; f[0] = 1; Table[ f[n], {n, 0, 12}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(21)-a(22) added by David Baugh, Mar 22 2015

A073516 Number of primes less than 10^n with initial digit 2.

Original entry on oeis.org

1, 3, 19, 146, 1129, 9142, 77025, 664277, 5837665, 52064915, 469864125, 4281198201, 39319600765, 363545360347, 3380562309312, 31590949437540, 296487794277035, 2793170342851930, 26402713858800478, 250324979315879678, 2379753569255122805, 22678735843184786383
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 2 (namely 2, 23 and 29).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
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

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[3*10^n] - PrimePi[2*10^n] + f[n - 1]; f[0] = 1; Table[ f[n], {n, 0, 13}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(21)-a(22) added by David Baugh, Mar 21 2015

A045713 Primes with first digit 7.

Original entry on oeis.org

7, 71, 73, 79, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000040.
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.
Column k=7 of A262369.

Programs

  • Magma
    [p: p in PrimesUpTo(7300) | Intseq(p)[#Intseq(p)] eq 7]; // Vincenzo Librandi, Aug 08 2014
    
  • Mathematica
    Select[ Table[ Prime[ n ], {n, 1000} ], First[ IntegerDigits[ # ]]==7& ]
  • Python
    from itertools import chain, count, islice
    from sympy import primerange
    def A045713_gen(): # generator of terms
        return chain.from_iterable(primerange(7*(m:=10**l),m<<3) for l in count(0))
    A045713_list = list(islice(A045713_gen(),40)) # Chai Wah Wu, Dec 08 2024
    
  • Python
    from sympy import primepi
    def A045713(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x+primepi(min(7*(m:=10**(l:=len(str(x))-1))-1,x))-primepi(min((m<<3)-1,x))+sum(primepi(7*(m:=10**i)-1)-primepi((m<<3)-1) for i in range(l))
        return bisection(f,n,n) # Chai Wah Wu, Dec 08 2024

Extensions

More terms from Erich Friedman.
Corrected by Jud McCranie, Jan 03 2001
a(13)=757 added from Vincenzo Librandi, Aug 08 2014

A045715 Primes with first digit 9.

Original entry on oeis.org

97, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257
Offset: 1

Views

Author

Keywords

Crossrefs

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.
Column k=9 of A262369.

Programs

  • Magma
    [p: p in PrimesUpTo(10^4) | Intseq(p)[#Intseq(p)] eq 9]; // Bruno Berselli, Jul 19 2014
    
  • Magma
    [p: p in PrimesInInterval(9*10^n,10^(n+1)), n in [0..3]]; // Bruno Berselli, Aug 08 2014
    
  • Mathematica
    Flatten[Table[Prime[Range[PrimePi[9 * 10^n] + 1, PrimePi[10^(n + 1)]]], {n, 3}]] (* Alonso del Arte, Jul 19 2014 *)
  • Python
    from itertools import chain, count, islice
    def A045715_gen(): # generator of terms
        return chain.from_iterable(primerange(9*(m:=10**l),10*m) for l in count(0))
    A045715_list = list(islice(A045715_gen(),40)) # Chai Wah Wu, Dec 08 2024
    
  • Python
    from sympy import primepi
    def A045715(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x+primepi(min(9*(m:=10**(l:=len(str(x))-1))-1,x))-primepi(min(10*m-1,x))+sum(primepi(9*(m:=10**i)-1)-primepi(10*m-1) for i in range(l))
        return bisection(f,n,n) # Chai Wah Wu, Dec 08 2024

Extensions

More terms from Erich Friedman.

A065680 Number of primes <= prime(n) which begin with a 1.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 13 2001

Keywords

Comments

Considering the frequency of all decimal digits in leading position of prime numbers (A065681 - A065687), we cannot apply Benford's Law. But we observe at 10^e - levels that the frequency for 0 to 9 decreases monotonically, at least in the small range until 10^7.
The "begins with 9" sequence is too dull to include. - N. J. A. Sloane
Note that the primes do not satisfy Benford's law (see A000040). - N. J. A. Sloane, Feb 08 2017

Examples

			13 is the second prime beginning with 1: A000040(6) = 13, therefore a(6) = 2. a(664579) = 80020 (A000040(664579) = 9999991 is the largest prime < 10^7).
		

Crossrefs

Programs

  • Mathematica
    Accumulate[If[First[IntegerDigits[#]]==1,1,0]&/@Prime[Range[80]]] (* Harvey P. Dale, Jan 22 2013 *)
  • PARI
    lista(n) = { my(a=[p\10^logint(p,10)==1 | p<-primes(n)]); for(i=2, #a, a[i]+=a[i-1]); a} \\ Harry J. Smith, Oct 26 2009

A073505 Number of primes == 1 (mod 10) less than 10^n.

Original entry on oeis.org

0, 5, 40, 306, 2387, 19617, 166104, 1440298, 12711386, 113761519, 1029517130, 9401960980, 86516370000
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Comments

Also Pi(n,5,1)
This and the related sequences A073505-A073517 and A006880, A073548-A073565 are included because there is interest in the distribution of primes by their initial or final digits.

Examples

			a(2) = 5 because there are 5 primes == 1 (mod 10) less than 10^2. They are 11, 31, 41, 61 and 71.
		

Crossrefs

Programs

  • Mathematica
    c = 0; k = 1; Do[While[k < 10^n, If[PrimeQ[k], c++ ]; k += 10]; Print[c], {n, 1, 10}]

Formula

a(n) + A073506(n) + A073507(n) + A073508(n) + 2 = A006880(n).

Extensions

Edited by Robert G. Wilson v, Oct 03 2002
a(10) from Robert G. Wilson v, Dec 22 2003
a(11)-a(13) from Giovanni Resta, Aug 07 2018

A073506 Number of primes == 3 (mod 10) less than 10^n.

Original entry on oeis.org

1, 7, 42, 310, 2402, 19665, 166230, 1440474, 12712499, 113765625, 1029509448, 9401979904, 86516427946
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Comments

Also Pi(n,5,3)
This and the related sequences A073505-A073517 and A006880, A073548-A073565 are included because there is interest in the distribution of primes by their initial or final digits.

Examples

			a(2)=7 because there are 7 primes == 3 (mod 10) less than 10^2. They are 3, 13, 23, 43, 53, 73 and 83.
		

Crossrefs

Programs

  • Mathematica
    c = 0; k = 3; Do[While[k < 10^n, If[PrimeQ[k], c++ ]; k += 10]; Print[c], {n, 1, 10}]

Formula

A073505(n) + a(n) + A073507(n) + A073508(n) + 2 = A006880(n).

Extensions

Edited by Robert G. Wilson v, Oct 03 2002
a(10) from Robert G. Wilson v, Dec 22 2003
a(11)-a(13) from Giovanni Resta, Aug 07 2018
Previous Showing 11-20 of 22 results. Next