login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072680 Difference between (least prime >= n) and (largest prime <= n). 4
0, 0, 2, 0, 2, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 2, 0, 6, 6, 6, 6, 6, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 0, 2, 0, 6, 6, 6, 6, 6, 0, 4, 4, 4, 0, 2, 0, 6, 6, 6, 6, 6, 0, 4, 4, 4, 0, 6, 6, 6, 6, 6, 0, 8, 8, 8, 8, 8, 8, 8, 0, 4, 4, 4, 0, 2, 0, 4, 4, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,3
COMMENTS
a(n) = 0 iff n is prime.
LINKS
FORMULA
a(n) = A007918(n) - A007917(n).
a(n) = A057427(n - A007917(n)) * A001223(A049084(A007917(n))).
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
Sequence in context: A029186 A283023 A288182 * A067770 A079200 A011420
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 01 2002
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 02:45 EDT 2024. Contains 371917 sequences. (Running on oeis4.)