A213329 Smallest k such that there are n - 1 primes between k*p(n) and k*p(n + 1) where p(n) is the n-th prime, or 0 if no such k exists.
1, 2, 2, 3, 8, 5, 13, 9, 8, 25, 10, 15, 31, 19, 19, 15, 56, 0, 33, 79, 26, 33, 0, 21, 54, 110, 52, 126, 57, 16, 71, 42, 140, 29, 130, 0, 51, 76, 51, 53, 179, 0, 192, 93, 216, 34, 34, 107, 247, 120, 84, 278, 0, 84, 105, 99, 301, 95, 154, 287, 0, 40, 154, 325
Offset: 1
Keywords
Examples
For n=4, p(4) = 7 and p(4 + 1) = 11. We are looking for an interval containing 4 - 1 = 3 primes. There are zero primes between 1 * 7 = 7 and 1 * 11 = 11. There are two primes between 2 * 7 = 14 and 2 * 11 = 22 (17 and 19). There are three primes between 3 * 7 = 21 and 3 * 11 = 33 (23, 29, and 31). So a(4) = 3.
Programs
-
PARI
a(n)=my(p=prime(n),q=nextprime(p+1),k,t=if(q/p>(1.+1/16597)^(n-1),2010760,max(exp(1/25/((q/p)^(1./(n-1))-1)),396738)));while(sum(i=k++*p+1,k*q-1,isprime(i))!=n-1,if(k>t,return(0)));k \\ Charles R Greathouse IV, Mar 06 2013
Extensions
a(13)-a(17) from Charles R Greathouse IV, Mar 06 2013
a(18)-a(64) from Michael B. Porter, Mar 12 2013
Comments