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.

A114262 p is the smallest prime that is greater than prime(n) such that prime(n)+2*p is a prime.

Original entry on oeis.org

5, 7, 11, 13, 17, 31, 41, 37, 37, 41, 47, 43, 47, 67, 73, 61, 83, 83, 79, 83, 89, 97, 97, 107, 103, 107, 151, 137, 127, 131, 139, 151, 191, 157, 179, 167, 173, 223, 199, 181, 191, 193, 197, 211, 227, 233, 227, 241, 257, 277, 307, 251, 313, 277, 283, 271, 293, 281
Offset: 2

Views

Author

Lei Zhou, Nov 20 2005

Keywords

Examples

			n=2: prime[2]=3; 3+2*5=13 is prime, so a(2)=5;
n=3: prime[3]=5; 5+2*7=19 is prime, so a(3)=7;
...
n=7: prime[7]=17; 17+2*19=55 is not prime
17+2*23=63 is not prime
...
17+2*31=79 is prime, so a(7)=31.
		

Crossrefs

Programs

  • Haskell
    a114262 n = head [q | let (p:ps) = drop (n - 1) a000040_list,
                          q <- ps, a010051 (p + 2 * q) == 1]
    -- Reinhard Zumkeller, Oct 29 2013
  • Mathematica
    Table[p1 = Prime[n1]; n2 = 1; p2 = Prime[n1 + n2]; While[cp = p1 + 2* p2; ! PrimeQ[cp], n2++; p2 = Prime[n1 + n2]]; p2, {n1, 2, 201}]

Extensions

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