login
A093032
Smallest k>0 such that at least two primes exist that are not less than n-k and not greater than n+k.
0
3, 2, 1, 1, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 3, 4, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 7, 6, 5, 4, 5, 6, 5, 4, 3, 2, 3
OFFSET
0,1
COMMENTS
2 <= A000720(n+a(n)) - A000720(n-a(n)-1) <= 3 for n>2.
MATHEMATICA
tpe[n_]:=Module[{k=1}, While[Count[Range[n-k, n+k], _?PrimeQ]<2, k++]; k]; Join[{3}, Array[tpe, 100]] (* Harvey P. Dale, Aug 22 2015 *)
CROSSREFS
Sequence in context: A016557 A073572 A073356 * A072115 A210650 A218754
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 07 2004
STATUS
approved