login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A114230 Largest prime p < prime(n) such that prime(n) + 2 * p is a prime. 11

%I #9 Jan 17 2022 13:41:10

%S 2,3,5,3,5,13,17,19,19,29,23,31,29,31,43,19,59,53,61,59,59,79,67,83,

%T 61,89,103,101,109,113,109,97,131,109,149,137,149,127,163,139,149,109,

%U 149,163,197,191,197,223,227,229,211,239,241,241,223,241,269,233,271,269

%N Largest prime p < prime(n) such that prime(n) + 2 * p is a prime.

%H Reinhard Zumkeller, <a href="/A114230/b114230.txt">Table of n, a(n) for n = 2..10000</a>

%e prime(2)=3, 3+2*2=7 is prime, so a(2)=2;

%e prime(3)=5, 5+2*3=11 is prime, so a(3)=3;

%e ...

%e prime(11)=31, 31+2*29=89 is prime, so a(11)=29.

%t 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}]

%t 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 *)

%o (Haskell)

%o a114230 n = head [p | let q = a000040 n,

%o p <- reverse $ takeWhile (< q) a000040_list,

%o a010051 (q + 2 * p) == 1]

%o -- _Reinhard Zumkeller_, Oct 29 2013

%Y Cf. A114227.

%Y Cf. A000040, A010051.

%K easy,nonn

%O 2,1

%A _Lei Zhou_, Nov 18 2005

%E Edited definition to conform to OEIS style. - _Reinhard Zumkeller_, Oct 29 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 11 23:26 EDT 2024. Contains 375080 sequences. (Running on oeis4.)