The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A051700 Distance from n to closest prime that is different from n. 13
 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 4, 1, 2, 1, 4, 1, 2, 3, 2, 1, 6, 1, 2, 3, 4, 3, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1 (list; graph; refs; listen; history; text; internal format)
 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 Related sequences: A023186-A023188, A046929-A046931, A051650, A051652, A051697-A051702, A051728-A051730. Sequence in context: A128591 A254444 A102005 * A337006 A025892 A025883 Adjacent sequences:  A051697 A051698 A051699 * A051701 A051702 A051703 KEYWORD nonn,easy,nice AUTHOR EXTENSIONS More terms from James A. Sellers STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified July 24 06:56 EDT 2021. Contains 346273 sequences. (Running on oeis4.)