login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051700 Distance from n to closest prime that is different from n. 11
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 * A025892 A025883 A111335

Adjacent sequences:  A051697 A051698 A051699 * A051701 A051702 A051703

KEYWORD

nonn,easy,nice

AUTHOR

N. J. A. Sloane

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 22:03 EDT 2019. Contains 328211 sequences. (Running on oeis4.)