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.

A046929 Width of moat of composite numbers surrounding n-th prime.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 5, 1, 1, 3, 1, 1, 3, 3, 5, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 5, 3, 3, 5, 1, 1, 1, 1, 1, 1, 11, 3, 1, 1, 3, 1, 1, 5, 5, 5, 1, 1, 3, 1, 1, 9, 3, 1, 1, 3, 5, 5, 1, 1, 3, 5, 5, 5, 3, 3, 5, 3, 3, 7, 1, 1, 1, 1, 3, 3, 5, 3, 1, 1, 3, 7, 3, 3
Offset: 1

Views

Author

Keywords

Examples

			23 has a buffer of 3 composites around it on each side: 20,21,22,23,24,25,26.
		

Crossrefs

Programs

  • Maple
    with(numtheory); a := i->min(ithprime(n)-ithprime(n-1)-1, ithprime(n+1)-ithprime(n)-1);
  • Mathematica
    a[n_] := Min[Prime[n] - Prime[n-1] - 1, Prime[n+1] - Prime[n] - 1]; a[1] = 0; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 16 2013 *)
    Join[{0},Min[Differences[#]]&/@Partition[Prime[Range[100]],3,1]-1] (* Harvey P. Dale, Feb 24 2014 *)