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.

A100742 Smallest prime p such that (p+prime(n))/2 is prime.

Original entry on oeis.org

2, 3, 5, 3, 3, 13, 5, 3, 3, 5, 3, 37, 5, 3, 11, 5, 3, 13, 7, 3, 13, 3, 3, 5, 37, 5, 3, 11, 13, 5, 7, 3, 5, 3, 17, 7, 37, 3, 11, 5, 23, 13, 3, 13, 5, 3, 3, 3, 47, 73, 29, 23, 13, 3, 5, 11, 5, 3, 37, 17, 19, 5, 7, 3, 13, 17, 3, 61, 11, 13, 5, 3, 19, 13, 3, 3, 5, 61, 53, 13, 3, 37, 23, 13, 7, 3, 5
Offset: 1

Views

Author

David Wasserman, Jan 03 2005

Keywords

Crossrefs

Cf. A084704.

Programs

  • PARI
    a(n) = {if (n==1, return (2)); p = 3; while(! isprime((prime(n)+p)/2), p = nextprime(p+1)); return (p);} \\ Michel Marcus, Jun 16 2013