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.

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.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Aug 21 2001

Keywords

Examples

			a(10) = 10 - (11 - 7)/2 = 1; a(11) = 11 - (11 + 11)/2 = 0.
		

Programs

  • PARI
    { for (n=2, 1000, write("b063933.txt", n, " ", n - (precprime(n) + nextprime(n))/2) ) } \\ Harry J. Smith, Sep 03 2009

Formula

a(n) = n - (A007917(n) + A007918(n))/2 = n - A063932(n).
a(n) = 0 for numbers in A063934 (i.e., in A000040 or A024675).