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.

A059787 Distance between 2*(n-th prime) and next prime.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Feb 22 2001

Keywords

Comments

If a(n)=1 then prime(n) is a Sophie Germain prime.

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(nextprime(2*ithprime(k))-2*ithprime(k),k=1..256)];
  • Mathematica
    Table[n2=2Prime[n];NextPrime[n2]-n2,{n,110}] (* Harvey P. Dale, Jun 07 2012 *)
  • PARI
    a(n) = my(pp=2*prime(n)); nextprime(pp) - pp; \\ Michel Marcus, Mar 22 2020