A063933 Difference between n and the average of largest prime less than or equal to n and smallest prime greater than or equal to n.
0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, -2, -1, 0, 1, 2, 0, 0, 0, -2, -1, 0, 1, 2, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, 0, 0, -2, -1, 0, 1, 2, 0, -1, 0, 1, 0, 0, 0, -2, -1, 0, 1, 2, 0, -1, 0, 1, 0, -2, -1, 0, 1, 2, 0, -3, -2, -1, 0, 1, 2, 3, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0
Offset: 2
Keywords
Examples
a(10) = 10 - (11 - 7)/2 = 1; a(11) = 11 - (11 + 11)/2 = 0.
Links
- Harry J. Smith, Table of n, a(n) for n = 2..1000
Programs
-
PARI
{ for (n=2, 1000, write("b063933.txt", n, " ", n - (precprime(n) + nextprime(n))/2) ) } \\ Harry J. Smith, Sep 03 2009