login
A114230
Largest prime p < prime(n) such that prime(n) + 2 * p is a prime.
11
2, 3, 5, 3, 5, 13, 17, 19, 19, 29, 23, 31, 29, 31, 43, 19, 59, 53, 61, 59, 59, 79, 67, 83, 61, 89, 103, 101, 109, 113, 109, 97, 131, 109, 149, 137, 149, 127, 163, 139, 149, 109, 149, 163, 197, 191, 197, 223, 227, 229, 211, 239, 241, 241, 223, 241, 269, 233, 271, 269
OFFSET
2,1
LINKS
EXAMPLE
prime(2)=3, 3+2*2=7 is prime, so a(2)=2;
prime(3)=5, 5+2*3=11 is prime, so a(3)=3;
...
prime(11)=31, 31+2*29=89 is prime, so a(11)=29.
MATHEMATICA
Table[p1 = Prime[n1]; n2 = n1 - 1; p2 = Prime[n2]; While[cp = p1 + 2*p2; ! PrimeQ[cp], n2--; If[n2 == 0, Print[n1]]; p2 = Prime[n2]]; p2, {n1, 2, 201}]
lp[n_]:=Module[{p=NextPrime[n, -1]}, While[!PrimeQ[n+2p], p=NextPrime[p, -1]]; p]; Table[lp[p], {p, Prime[Range[2, 70]]}] (* Harvey P. Dale, Jan 17 2022 *)
PROG
(Haskell)
a114230 n = head [p | let q = a000040 n,
p <- reverse $ takeWhile (< q) a000040_list,
a010051 (q + 2 * p) == 1]
-- Reinhard Zumkeller, Oct 29 2013
CROSSREFS
Cf. A114227.
Sequence in context: A193957 A336746 A209769 * A209753 A185191 A103781
KEYWORD
easy,nonn
AUTHOR
Lei Zhou, Nov 18 2005
EXTENSIONS
Edited definition to conform to OEIS style. - Reinhard Zumkeller, Oct 29 2013
STATUS
approved