A133450 Difference between 4*n^2 and the average of the two prime numbers which bracket this number.
0, 1, 2, 0, 1, 0, 1, 2, 0, 1, 1, 2, 1, 4, 3, -2, -2, 2, 1, 1, -4, -5, -5, 1, 10, 1, 3, 7, -2, 0, 4, 0, 3, -5, 4, 0, 2, 12, 0, -9, -2, 6, -6, -3, 3, 0, 2, 1, -3, 10, -9, 1, 10, -3, 1, 0, 4, 2, -2, 5, 1, 1, 8, -12, 5, -1, 8, -2, 0, 0, -3, -1, 1, 2, 8, -4, 12, 3, 4, 5, 1, -2, -10, 0, 10
Offset: 1
Keywords
Examples
a(1)=0 because 4 - (3 + 5)/2 = 0 a(2)=1 because 16 - (13 + 17)/2 = 1 a(3)=2 because 36 - (31 + 37)/2 = 2 a(4)=0 because 64 - (61 + 67)/2 = 0 a(5)=1 because 100 - (97 + 101)/2 = 1
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Table[n^2-(Prime[PrimePi[n^2]]+Prime[PrimePi[n^2]+1])/2,{n,2,200,2}] (* Zak Seidov *) diff4[n_]:=Module[{x=4n^2},x-(NextPrime[x]+NextPrime[x,-1])/2]; Array[ diff4,90] (* Harvey P. Dale, Aug 31 2017 *)
-
PARI
A133450(n)=4*n^2-(precprime(4*n^2)+nextprime(4*n^2))/2 \\ M. F. Hasler, Dec 26 2007
Formula
a(n) = A056929(2n). - M. F. Hasler, Dec 26 2007
Extensions
Corrected and extended by Zak Seidov, Dec 23 2007
Edited by N. J. A. Sloane, Dec 23 2007