%I #17 Dec 21 2021 23:47:26
%S 0,0,1,1,1,1,1,1,3,1,1,3,1,1,3,5,1,1,3,1,1,3,3,5,3,1,1,1,1,3,3,3,1,1,
%T 1,1,5,3,3,5,1,1,1,1,1,1,11,3,1,1,3,1,1,5,5,5,1,1,3,1,1,9,3,1,1,3,5,5,
%U 1,1,3,5,5,5,3,3,5,3,3,7,1,1,1,1,3,3,5,3,1,1,3,7,3,3
%N Width of moat of composite numbers surrounding n-th prime.
%H T. D. Noe, <a href="/A046929/b046929.txt">Table of n, a(n) for n = 1..10000</a>
%H Jean-François Alcover, <a href="/A046929/a046929.txt">Frequency distribution up to 10^6 terms.</a>
%e 23 has a buffer of 3 composites around it on each side: 20,21,22,23,24,25,26.
%p with(numtheory); a := i->min(ithprime(n)-ithprime(n-1)-1, ithprime(n+1)-ithprime(n)-1);
%t a[n_] := Min[Prime[n] - Prime[n-1] - 1, Prime[n+1] - Prime[n] - 1]; a[1] = 0; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Apr 16 2013 *)
%t Join[{0},Min[Differences[#]]&/@Partition[Prime[Range[100]],3,1]-1] (* _Harvey P. Dale_, Feb 24 2014 *)
%Y Related sequences: A023186-A023188, A046929-A046931, A051650, A051652, A051697-A051702, A051728-A051730.
%K nonn,easy,nice
%O 1,9
%A _N. J. A. Sloane_
|