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.

A159461 Numbers of previous and following composites of n-th prime.

Original entry on oeis.org

0, 1, 2, 4, 4, 4, 4, 4, 8, 6, 6, 8, 4, 4, 8, 10, 6, 6, 8, 4, 6, 8, 8, 12, 10, 4, 4, 4, 4, 16, 16, 8, 6, 10, 10, 6, 10, 8, 8, 10, 6, 10, 10, 4, 4, 12, 22, 14, 4, 4, 8, 6, 10, 14, 10, 10, 6, 6, 8, 4, 10, 22, 16, 4, 4, 16, 18, 14, 10, 4, 8, 12, 12, 10, 8, 8, 12
Offset: 1

Views

Author

Jaroslav Krizek, Apr 12 2009

Keywords

Comments

Essentially the same as A046930. - R. J. Mathar, Apr 16 2009
For twin primes this is the gap before or after the twins, e.g., a(17) = 6 = 59 - 53 = prime(17) - prime(16) for the twin (59, 61) with a(18) = 6 = 67 - 61 = prime(19) - prime(18). - Frank Ellermann, Mar 17 2020

Examples

			For a(16) = 10 = 59 - 47 - 2 = prime(16+1) - prime(16-1) - 2 is the sum of the prime gaps minus two ending and starting at prime(16) = 53.
		

Crossrefs

Programs

  • Mathematica
    Join[{0},Total[Differences[#]-1]&/@Partition[Prime[Range[60]],3,1]] (* Harvey P. Dale, Nov 27 2011 *)

Formula

For n >= 2, we have
a(n) = A001223(n) + A001223(n-1) - 2;
a(n) = A046933(n) + A046933(n-1);
a(n) = A008578(n+2) - A008578(n) - 2;
a(n) = A158611(n+3) - A158611(n+1) - 2.

Extensions

Correction for change of offset in A158611 and A008578 in Aug 2009 Jaroslav Krizek, Jan 27 2010