cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A063932 Average of largest prime less than or equal to n and smallest prime greater than or equal to n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Aug 21 2001

Keywords

Examples

			a(7) = (7 + 7)/2 = 7;
a(8) = (7 + 11)/2 = 9.
		

Crossrefs

Interleaving of A000040 and A001223-1 copies of A024675. Cf. A063934.

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

Formula

a(n) = (A007917(n) + A007918(n))/2 = n - A063933(n).