OFFSET
1,1
COMMENTS
Previous name: Lower prime in a twin pair that yields another.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = A066388(n)-1. - R. J. Mathar, Nov 02 2023
EXAMPLE
659 and 661 form a prime twin pair. Their sum is 1320. 1320 is sandwiched between 1319 and 1321, which form another prime twin pair. So 659 is in the sequence.
MATHEMATICA
p = q = 1; Do[q = Prime[n]; If[p + 2 == q && PrimeQ[2p + 1] && PrimeQ[2p + 3], Print[p]]; p = q, {n, 1, 10^4}]
Select[Prime[Range[15000]], PrimeQ[# + 2] && PrimeQ[2 # + 1] && PrimeQ[2 # + 3]&] (* Vincenzo Librandi, Apr 09 2013 *)
PROG
(Magma) [p: p in PrimesUpTo(160000) | IsPrime(p+2) and IsPrime(2*p+1) and IsPrime(2*p+3)]; // Vincenzo Librandi, Apr 09 2013
(PARI) forprime(p=1, 10^5, if(isprime(p+2)&&isprime(2*p+1)&&isprime(2*p+3), print1(p, ", "))) \\ Derek Orr, Mar 11 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Neil Fernandez, Apr 08 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Apr 11 2002
STATUS
approved