A279862 a(n) = the smallest integer k where there are exactly n primes between 10k and 10k+100.
37027, 15590, 3562, 3561, 1881, 1856, 735, 588, 132, 131, 188, 111, 89, 47, 44, 32, 20, 11, 9, 8, 5, 3, 2
Offset: 0
Examples
For n = 1 there is only one prime between 155900 and 156000: 155921.
Programs
-
Maple
for n from 1 to 10^5 do T[n]:= nops(select(isprime, [$10*n+1 ..10*n+9])) od: for k from 1 to 10^5-10 do v:= add(T[k+j],j=0..9): if not assigned(A[v]) then A[v]:= k fi od: seq(A[n],n=0..22); # Robert Israel, Jul 12 2017
-
Mathematica
Function[s, -1 + Flatten@ Table[FirstPosition[s, n] /. k_ /; MissingQ@ k -> 0, {n, 0, Max@ s}]]@ Table[Count[Range[10 k, 10 k + 100], ?PrimeQ], {k, 0, 10^5}] (* _Michael De Vlieger, Jul 12 2017; program writes "-1" for a(23) and a(24). *)
-
PARI
a(n) = my(k=0); while(1, if(primepi(10*k+100)-primepi(10*k)==n, return(k)); k++) \\ Felix Fröhlich, Jul 12 2017
-
PARI
a(n)=my(k); while(sum(p=10*k+1,10*k+99,isprime(p))!=n, k++); k \\ Charles R Greathouse IV, Jul 12 2017
Extensions
Name clarified by FUNG Cheok Yin, Jul 12 2017
Comments