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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007920 Smallest number k such that n + k is prime. 12
2, 1, 0, 0, 1, 0, 1, 0, 3, 2, 1, 0, 1, 0, 3, 2, 1, 0, 1, 0, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 1, 0, 5, 4, 3, 2, 1, 0, 3, 2, 1, 0, 1, 0, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 1, 0, 5, 4, 3, 2, 1, 0, 3, 2, 1, 0, 1, 0, 5, 4, 3, 2, 1, 0, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 3, 2, 1, 0, 1, 0, 3, 2, 1, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

a(n) = A007918(n) - n.

LINKS

T. D. Noe, Table of n, a(n) for n = 0..10000

M. Popescu, V. Seleacu, About the Smarandache Complementary Prime Function, Smarandache Notions Journal, Vol. 7, No. 1-2-3, 1996, 12-22.

F. Smarandache, Only Problems, Not Solutions!, via viXra.

EXAMPLE

a(22) = 1 because 22 + 1 = 23, the next higher prime.

a(23) = 0 because 23 is prime.

a(24) = 5 because 24 + 5 = 29, the next higher prime.

a(25) = 4 because 25 + 4 = 29, the next higher prime.

MATHEMATICA

distToPrime[n_] := If[PrimeQ[n], 0, NextPrime[n] - n]; Array[distToPrime, 110, 0] (* Harvey P. Dale, Sep 19 2011 *)

PROG

(PARI) a(n)=nextprime(n)-n

CROSSREFS

Cf. A064722, A013632 (a slightly different version).

Sequence in context: A316825 A246398 A051699 * A127587 A175832 A321223

Adjacent sequences:  A007917 A007918 A007919 * A007921 A007922 A007923

KEYWORD

nonn,easy

AUTHOR

R. Muller

EXTENSIONS

More terms from Joanna S. Bartlett (s1117611(AT)cedarville.edu)

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 15 03:09 EDT 2019. Contains 328025 sequences. (Running on oeis4.)