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.

A060267 Difference between 2 closest primes surrounding 2n.

Original entry on oeis.org

2, 2, 4, 4, 2, 4, 4, 2, 4, 4, 6, 6, 6, 2, 6, 6, 6, 4, 4, 2, 4, 4, 6, 6, 6, 6, 6, 6, 2, 6, 6, 6, 4, 4, 2, 6, 6, 6, 4, 4, 6, 6, 6, 8, 8, 8, 8, 4, 4, 2, 4, 4, 2, 4, 4, 14, 14, 14, 14, 14, 14, 14, 4, 4, 6, 6, 6, 2, 10, 10, 10, 10, 10, 2, 6, 6, 6, 6, 6, 6, 4, 4, 6, 6, 6, 6, 6, 6, 2, 10, 10, 10, 10, 10, 2, 4
Offset: 2

Views

Author

Labos Elemer, Mar 23 2001

Keywords

Examples

			a(3) = 2 because the closest primes to 2*3 = 6 are (5,7) and the difference between these is 2. - _Michael De Vlieger_, Nov 02 2017
		

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(nextprime(2*i)-prevprime(2*i),i=2..256)];
  • Mathematica
    Array[Subtract @@ NextPrime[#, {1, -1}] &[2 #] &, 96, 2] (* Michael De Vlieger, Nov 02 2017 *)
    NextPrime[#]-NextPrime[#,-1]&/@(2*Range[2,100]) (* Harvey P. Dale, Nov 07 2017 *)
  • PARI
    a(n) = nextprime(2*n+1) - precprime(2*n-1); \\ Michel Marcus, Sep 16 2020