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

 

Logo

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072680 Difference between (least prime >= n) and (largest prime <= n). 2
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

Table of n, a(n) for n=2..106.

FORMULA

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

CROSSREFS

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

Cf. A072681, A013633.

Sequence in context: A179461 A238763 A029186 * A067770 A079200 A011420

Adjacent sequences:  A072677 A072678 A072679 * A072681 A072682 A072683

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 | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified December 8 11:15 EST 2016. Contains 278939 sequences.