OFFSET
1,3
COMMENTS
a(n) can be thought of as the radius of the largest 1-dimensional circle centered at prime(n) and consisting entirely of primes.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
r = 4 is the largest nonnegative integer r such that prime(4) + 4 = 11 and prime(4) - 4 = 3 are both prime; so a(4) = 4.
MATHEMATICA
a[p_] := Module[{k = p-3}, While[!PrimeQ[p+k] || !PrimeQ[p-k], k-=2]; k]; Join[{0}, a/@Select[Range[3, 1000], PrimeQ]] (* Amiram Eldar, Mar 24 2019 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joseph L. Pe, Mar 12 2005
STATUS
approved