login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A114263
Smallest number m such that prime(n) + 2*prime(n+m) is a prime.
3
1, 1, 1, 1, 1, 4, 5, 3, 2, 2, 3, 1, 1, 4, 5, 1, 5, 4, 2, 2, 2, 2, 1, 3, 1, 1, 8, 4, 1, 1, 2, 3, 9, 2, 5, 2, 2, 9, 6, 1, 1, 1, 1, 2, 3, 4, 1, 4, 5, 8, 11, 1, 11, 4, 5, 1, 4, 1, 5, 8, 1, 1, 1, 1, 2, 5, 1, 5, 9, 2, 1, 10, 3, 4, 4, 5, 5, 6, 7, 4, 1, 1, 2, 4, 13, 6, 6, 6, 7, 9, 1, 3, 1, 7, 3, 9, 1, 3, 3, 6, 3, 8, 2
OFFSET
2,6
LINKS
EXAMPLE
n=2: prime(2)+2*prime(2+1)=3+2*5=13 is prime, so a(2)=1;
n=3: prime(3)+2*prime(3+1)=5+2*7=19 is prime, so a(2)=1;
...
n=7: prime(7)+2*prime(7+1)=17+2*19=55 is not prime
...
prime(7)+2*prime(7+4)=17+2*31=79 is prime, so a(7)=4;
MATHEMATICA
Table[p1 = Prime[n1]; n2 = 1; p2 = Prime[n1 + n2]; While[cp = p1 + 2* p2; ! PrimeQ[cp], n2++; p2 = Prime[n1 + n2]]; n2, {n1, 2, 201}]
PROG
(Haskell)
a114263 n = head [m | m <- [1..n],
a010051 (a000040 n + 2 * a000040 (n + m)) == 1]
-- Reinhard Zumkeller, Oct 31 2013
KEYWORD
easy,nonn
AUTHOR
Lei Zhou, Nov 20 2005
EXTENSIONS
Edited definition to conform to OEIS style. - Reinhard Zumkeller, Oct 31 2013
STATUS
approved