This site is supported by donations to The OEIS Foundation.

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

%I

%S 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,

%T 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,

%U 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

%N Difference between (least prime >= n) and (largest prime <= n).

%C a(n)=0 iff n is prime.

%F a(n) = A057427(n - A007917(n)) * A001223(A049084(A007917(n))).

%t f[n_]:=If[PrimeQ[n],0,NextPrime[n]-NextPrime[n,-1]];Array[f,110,2] (* From Harvey P. Dale, Sep 22 2011 *)

%o (Mupad) numlib::prevprime(i)*(-1)-nextprime(i)*(-1)\$ i = 2..106 - Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Feb 26 2007

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

%Y Cf. A072681, A013633.

%K nonn

%O 2,3

%A _Reinhard Zumkeller_, Jul 01 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

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