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.

A063934 Numbers which are either prime or the average of consecutive odd primes.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19, 21, 23, 26, 29, 30, 31, 34, 37, 39, 41, 42, 43, 45, 47, 50, 53, 56, 59, 60, 61, 64, 67, 69, 71, 72, 73, 76, 79, 81, 83, 86, 89, 93, 97, 99, 101, 102, 103, 105, 107, 108, 109, 111, 113, 120, 127, 129, 131, 134, 137, 138
Offset: 1

Views

Author

Henry Bottomley, Aug 21 2001

Keywords

Comments

Numbers n such that nextprime(n-1) + prevprime(n+1) = 2n. - Wesley Ivan Hurt, May 13 2017

Examples

			7 is prime, 9 is the average of 7 and 11, 11 is prime, 12 is the average of 11 and 13; so 7, 9, 11 and 13 are in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Function[p, Union@ Join[p, Rest@ Map[Mean, Partition[p, 2, 1]]]]@ Prime@ Range@ 34 (* Michael De Vlieger, May 13 2017 *)
  • PARI
    { for (n=1, 1000, if (n==1, a=2; p=3, if (n%2, a=(q + p=nextprime(q + 1))/2, a=q=p)); write("b063934.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 03 2009

Formula

For n >= 1: a(2n)=A000040(n+1); a(2n+1)=(A000040(n+1)+A000040(n+2))/2 =A024675(n).