login
A114236
Smallest number m such that 2*prime(n)+prime(n-m) is a prime.
4
1, 1, 1, 1, 1, 5, 3, 4, 4, 2, 2, 1, 1, 2, 6, 1, 2, 8, 5, 2, 2, 2, 1, 4, 1, 1, 5, 11, 1, 1, 2, 2, 8, 3, 2, 5, 2, 2, 3, 1, 1, 1, 1, 5, 2, 3, 1, 10, 4, 4, 4, 1, 5, 12, 9, 1, 2, 1, 5, 3, 1, 1, 1, 1, 12, 2, 1, 6, 6, 5, 1, 5, 3, 8, 3, 6, 4, 4, 6, 5, 1, 1, 4, 2, 5, 11, 4, 11, 6, 12, 1, 6, 1, 3, 7, 10, 1, 9, 5, 3, 3, 9
OFFSET
3,6
LINKS
EXAMPLE
n=3: 2*prime(3)+prime(3-1)=2*5+3=13 is prime, so a(3)=1;
n=4: 2*prime(4)+prime(4-1)=2*7+5=19 is prime, so a(4)=1;
...
n=8: 2*prime(8)+prime(8-5)=2*19+5=43 is prime, so a(8)=5;
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]]; n2, {n1, 3, 202}]
PROG
(Haskell)
a114236 n = head [m | m <- [1..],
a010051 (2 * a000040 n + 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