OFFSET
1,2
COMMENTS
Subsidiary sequence suggested in A088104.
LINKS
Tomás Oliveira e Silva, Tables of values of pi(x) and of pi2(x)
EXAMPLE
a(2) = 2 since 31 and 37 are the only two 2-digit primes beginning with prime(2) = 3.
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ray Chandler, Oct 15 2003
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
STATUS
approved