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.

A114228 Smallest number m such that prime(n)+2*prime(m) is a prime.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 2, 4, 2, 1, 6, 2, 1, 2, 4, 1, 2, 1, 2, 1, 4, 1, 2, 4, 3, 4, 2, 2, 1, 2, 2, 4, 3, 2, 1, 4, 7, 5, 1, 2, 1, 2, 8, 3, 2, 2, 2, 4, 2, 1, 6, 3, 4, 1, 2, 1, 4, 2, 3, 2, 1, 2, 4, 2, 2, 1, 2, 12, 1, 8, 3, 4, 3, 6, 2, 1, 2, 4, 1, 2, 1, 12, 11, 1, 14, 1, 2, 4, 6, 7, 2, 3, 2, 2, 8
Offset: 2

Views

Author

Lei Zhou, Nov 18 2005

Keywords

Comments

a(A114229(n)) = n for n >=1 and a(m) <> n for m < A114229(n). - Reinhard Zumkeller, Oct 31 2013

Examples

			prime(2)=3, 3+2*prime(1)=7 is prime, so a(2)=1;
prime(3)=5, 5+2*prime(2)=11 is prime, so a(3)=2;
...
prime(20)=71, 71+2*prime(6)=97 is prime, so a(20)=6.
		

Crossrefs

Programs

  • Haskell
    a114228 n = head [m | m <- [1..],
                          a010051 (a000040 n + 2 * a000040 m) == 1]
    -- Reinhard Zumkeller, Oct 31 2013
  • Mathematica
    Table[p1 = Prime[n1]; n2 = 1; p2 = 2; While[ cp = p1 + 2*p2; ! PrimeQ[cp], n2++; p2 = Prime[n2]]; n2, {n1, 2, 201}]