OFFSET
2,3
COMMENTS
a(n) = 0 iff n is prime.
LINKS
Antti Karttunen, Table of n, a(n) for n = 2..65537
FORMULA
MATHEMATICA
f[n_]:=If[PrimeQ[n], 0, NextPrime[n]-NextPrime[n, -1]]; Array[f, 110, 2] (* Harvey P. Dale, Sep 22 2011 *)
PROG
(MuPAD) numlib::prevprime(i)*(-1)-nextprime(i)*(-1)$ i = 2..106 // Zerinvary Lajos, Feb 26 2007
(PARI) A072680(n) = (nextprime(n) - precprime(n)); \\ Antti Karttunen, Sep 23 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 01 2002
STATUS
approved