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.

A100820 Number of odd numbers between prime(n) and prime(n+1).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 2, 0, 2, 1, 0, 2, 1, 2, 3, 1, 0, 1, 0, 1, 6, 1, 2, 0, 4, 0, 2, 2, 1, 2, 2, 0, 4, 0, 1, 0, 5, 5, 1, 0, 1, 2, 0, 4, 2, 2, 2, 0, 2, 1, 0, 4, 6, 1, 0, 1, 6, 2, 4, 0, 1, 2, 3, 2, 2, 1, 2, 3, 1, 3, 4, 0, 4, 0, 2, 1, 2, 3, 1, 0, 1, 5, 3, 1, 3, 1, 2, 5, 0, 8, 2, 4, 2, 2, 0, 2
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 06 2005

Keywords

Examples

			a(2)=0 because between 3 and 5 there are no odd numbers.
a(3)=0 because between 5 and 7 there are no odd numbers.
		

Crossrefs

Programs

  • Magma
    [0] cat [(NthPrime(n+1)-NthPrime(n))/2-1 : n in [2..100]]; // Wesley Ivan Hurt, Jun 01 2016
  • Maple
    P:= select(isprime,[seq(i,i=3..1000,2)]):
    0,op(map(`-`,1/2*(P[2..-1]-P[1..-2]),1)); # Robert Israel, Jun 01 2016
  • Mathematica
    Table[Floor[Max[(Prime[n + 1] - Prime[n])/2 - 1, 0] ], {n, 120}] (* Ray Chandler, Jan 09 2005 *)

Formula

a(n) = (prime(n+1)-prime(n))/2-1 = A001223(n)/2-1 for n>=2. - Robert Israel, Jun 01 2016
a(n) = A028334(n) - 1 for n>=2. - Michel Marcus, Jan 04 2023

Extensions

Corrected and extended by Ray Chandler, Jan 09 2005