A063932 Average of largest prime less than or equal to n and smallest prime greater than or equal to n.
2, 3, 4, 5, 6, 7, 9, 9, 9, 11, 12, 13, 15, 15, 15, 17, 18, 19, 21, 21, 21, 23, 26, 26, 26, 26, 26, 29, 30, 31, 34, 34, 34, 34, 34, 37, 39, 39, 39, 41, 42, 43, 45, 45, 45, 47, 50, 50, 50, 50, 50, 53, 56, 56, 56, 56, 56, 59, 60, 61, 64, 64, 64, 64, 64, 67, 69, 69, 69, 71, 72, 73
Offset: 2
Keywords
Examples
a(7) = (7 + 7)/2 = 7; a(8) = (7 + 11)/2 = 9.
Links
- Harry J. Smith, Table of n, a(n) for n = 2..1000
Programs
-
Mathematica
Table[Mean[{NextPrime[n-1],NextPrime[n+1,-1]}],{n,2,80}] (* Harvey P. Dale, Nov 22 2011 *)
-
PARI
{ for (n=2, 1000, write("b063932.txt", n, " ", (precprime(n) + nextprime(n))/2) ) } \\ Harry J. Smith, Sep 02 2009