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

%I #17 Nov 30 2019 18:21:50

%S 1,4,16,106,861,7216,61938,541854,4814936,43336106,394050419,

%T 3612791400,33353349498,309745405634,2891246183239,27107799609004,

%U 255151905596682,2409933230413924,22832347500212719,216919281298152512,2066001163137387739,19721816247905813257

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

%C 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.

%H Cino Hilliard, <a href="http://groups.yahoo.com/group/seqfun/message/58">Count primes in a range</a>.

%H Cino Hilliard, <a href="/A131043/a131043.txt">Count primes in a range up to 10^18</a>, message 58 in seqfun Yahoo group, providing code for gcc (needs formatting to become compilable), Sep 23, 2007. [Cached copy]

%e 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.

%o (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),","))

%Y Cf. A006880, A309329.

%K nonn

%O 1,2

%A _Cino Hilliard_, Sep 23 2007

%E a(13)-a(19) from _Hugo Pfoertner_, Nov 16 2019

%E a(20)-a(21) from _Chai Wah Wu_, Nov 29 2019

%E a(22) from _Chai Wah Wu_, Nov 30 2019