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.

A088754 Number of n-digit primes beginning with prime(n).

Original entry on oeis.org

1, 2, 14, 107, 103, 851, 6931, 59557, 518971, 4585526, 41368791, 375232730, 3441863700, 31843327587, 295907384843, 2761221438054, 25890141962275, 244138314690159, 2306482418751769, 21874074143081175, 208132164249925671, 1983046852246630734, 18946883921641542673
Offset: 1

Views

Author

Ray Chandler, Oct 15 2003

Keywords

Comments

Subsidiary sequence suggested in A088104.

Examples

			a(2) = 2 since 31 and 37 are the only two 2-digit primes beginning with prime(2) = 3.
		

Crossrefs

Programs

  • PARI
    A088754(n)={ local (resul,sdig,p,lo,hi) ; sdig=prime(n) ; lo=sdig ; hi=sdig+1 ; while( lo < 10^(n-1), lo *= 10 ; hi *= 10 ; ) ; resul=0 ; p=nextprime(lo) ; while(p < hi, resul++ ; p=nextprime(p+1) ; ) ; return(resul) ; }
    { for(n=1,11, print(A088754(n)); ) } \\ R. J. Mathar, Sep 25 2006
    
  • Python
    from sympy import prime, primepi
    def A088754(n):
        p = prime(n)
        m = n-len(str(p))
        return primepi((p+1)*10**m)-primepi(p*10**m) # Chai Wah Wu, Jun 18 2019

Extensions

a(10) from R. J. Mathar, Sep 25 2006
a(11)-a(14) from Floris P. van Doorn and Jasper Mulder (florisvandoorn(AT)hotmail.com), Oct 12 2009
a(15)-a(22) from Donovan Johnson, Apr 24 2013
a(23) from Chai Wah Wu, Jun 19 2019