OFFSET
0,1
LINKS
T. D. Noe, Table of n, a(n) for n = 0..10000
EXAMPLE
Closest primes to 0,1,2,3,4 are 2,2,3,2,3.
MAPLE
with(numtheory); f := n->min(nextprime(n)-n, n-prevprime(n));
MATHEMATICA
Table[Min[NextPrime[n]-n, n-NextPrime[n, -1]], {n, 0, 200}] (* Harvey P. Dale, Mar 27 2011 *)
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from James A. Sellers
STATUS
approved