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.

A114235 Largest prime p < prime(n) such that 2*prime(n) + p is a prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 5, 13, 13, 17, 29, 31, 41, 43, 43, 31, 59, 59, 37, 53, 71, 73, 79, 89, 79, 101, 103, 89, 67, 113, 127, 127, 131, 103, 137, 149, 137, 157, 163, 163, 179, 181, 191, 193, 179, 197, 197, 223, 173, 211, 223, 227, 241, 229, 193, 223, 269, 269, 277, 263
Offset: 3

Views

Author

Lei Zhou, Nov 20 2005

Keywords

Examples

			n=3: 2*prime(3)+3=2*5+3=13 is prime, so a(3)=3;
n=4: 2*prime(4)+5=2*7+5=19 is prime, so a(4)=5;
...
n=8: 2*prime(8)+17=2*19+17=55 is not prime
2*prime(8)+13=2*19+13=51 is not prime
...
2*prime(8)+5=2*19+5=43 is prime, so a(8)=5;
		

Crossrefs

Programs

  • Haskell
    a114235 n = head [p | let q = a000040 n,
                          p <- reverse $ takeWhile (< q) a000040_list,
                          a010051 (2 * q + p) == 1]
    -- Reinhard Zumkeller, Oct 29 2013
  • Mathematica
    Table[p1 = Prime[n1]; n2 = 1; p2 = Prime[n1 - n2]; While[cp = 2*p1 + p2; ! PrimeQ[cp], n2++; If[n2 >= n1, Print[n1]]; p2 = Prime[n1 - n2]]; p2, {n1, 3, 202}]

Extensions

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