login
A114233
Smallest number m such that 2*prime(n) + prime(m) is a prime.
5
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,1
LINKS
EXAMPLE
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.
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 *)
PROG
(Haskell)
a114233 n = head [m | m <- [1 .. n],
a010051' (2 * a000040 n + a000040 m) == 1]
-- Reinhard Zumkeller, Oct 31 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Lei Zhou, Nov 20 2005
EXTENSIONS
Edited definition to conform to OEIS style. - Reinhard Zumkeller, Oct 31 2013
STATUS
approved