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.

A114265 Smallest prime p greater than prime(n) such that 2*prime(n) + p is a prime.

Original entry on oeis.org

3, 5, 7, 17, 19, 17, 19, 23, 37, 31, 41, 53, 67, 53, 73, 61, 61, 71, 89, 97, 83, 83, 97, 103, 113, 109, 107, 139, 113, 127, 167, 139, 157, 179, 151, 197, 173, 173, 223, 211, 199, 239, 211, 227, 199, 233, 239, 227, 229, 233, 277, 241, 251, 271, 283, 271, 271, 281
Offset: 1

Views

Author

Lei Zhou, Nov 20 2005

Keywords

Comments

Note that p is next prime after prime(n) iff prime(n) is a term in A173971. - Zak Seidov, Feb 11 2015

Examples

			n=1: 2*prime[1]+3=2*2+3=7 is prime, so a(1)=3;
n=2: 2*prime[2]+5=2*3+5=11 is prime, so a(2)=5;
...
n=4: 2*prime[4]+3=2*7+3=17 is prime, so a(4)=17.
		

Crossrefs

Programs

  • Haskell
    a114265 n = head [p | let (q:qs) = drop (n - 1) a000040_list, p <- qs,
                          a010051 (2 * q + p) == 1]
    -- Reinhard Zumkeller, Oct 31 2013
    
  • Mathematica
    Table[p1 = Prime[n1]; n2 = 1; p2 = Prime[n1 + n2]; While[cp = 2*p1 + p2; ! PrimeQ[cp], n2++; p2 = Prime[n1 + n2]]; p2, {n1, 1, 200}]
  • PARI
    a(n)=forprime(p=prime(n)+1,,if(isprime(2*prime(n)+p),return(p)))
    vector(100,n,a(n)) \\ Derek Orr, Feb 11 2015

Extensions

Edited definition to conform to OEIS style. - Reinhard Zumkeller, Oct 31 2013