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

 

Logo

Invitation: celebrating 50 years of OEIS, 250000 sequences, and Sloane's 75th, there will be a conference at DIMACS, Rutgers, Oct 9-10 2014.

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

Content is available under The OEIS End-User License Agreement .

Last modified September 2 13:34 EDT 2014. Contains 246357 sequences.