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
KEYWORD
nonn,easy
AUTHOR
R. Muller
EXTENSIONS
More terms from Joanna S. Bartlett (s1117611(AT)cedarville.edu)
STATUS
approved