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.

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

Original entry on oeis.org

2, 2, 4, 2, 2, 2, 4, 2, 3, 3, 4, 2, 2, 2, 6, 3, 2, 4, 2, 3, 4, 2, 2, 11, 3, 6, 3, 2, 2, 4, 2, 2, 6, 3, 2, 3, 2, 2, 11, 3, 4, 2, 2, 2, 5, 2, 2, 2, 6, 6, 3, 4, 4, 11, 2, 3, 2, 4, 2, 4, 2, 8, 3, 4, 5, 2, 4, 2, 2, 14, 3, 3, 2, 2, 8, 2, 4, 2, 8, 5, 8, 5, 2, 14, 6, 3, 4, 2, 2, 6, 2, 11, 5, 2, 2, 4, 2, 3, 2, 2, 2, 6, 5
Offset: 3

Views

Author

Lei Zhou, Nov 20 2005

Keywords

Examples

			n=3: 2*prime(3)+prime(2)=2*5+3=13 is prime, so a(3)=2;
n=4: 2*prime(4)+prime(2)=2*7+3=17 is prime, so a(4)=2;
n=5: 2*prime(5)+prime(2)=2*11+3=25 is not prime
...
2*prime(5)+prime(4)=2*11+7=29 is prime, so a(5)=4.
		

Crossrefs

Programs

  • Haskell
    a114233 n = head [m | m <- [1 .. n],
                          a010051' (2 * a000040 n + a000040 m) == 1]
    -- Reinhard Zumkeller, Oct 31 2013
  • Mathematica
    Table[p1 = Prime[n1]; n2 = 1; p2 = Prime[n2]; While[cp = 2*p1 + p2; ! PrimeQ[cp], n2++; If[n2 >= n1, Print[n1]]; p2 = Prime[n2]]; n2, { n1, 3, 202}]
    snm[n_]:=Module[{m=1,p=2Prime[n]},While[!PrimeQ[p+Prime[m]],m++];m]; Array[ snm,110,3] (* Harvey P. Dale, Sep 30 2017 *)

Extensions

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