OFFSET
1,2
COMMENTS
A013916 lists numbers n such that the sum of the first n primes is prime. With similar motivation, twin prime pairs generate prime pairs in this sequence. Note that 2*n also gives the difference between members of prime pair that is generated by sum of first n twin prime pairs.
First differences of this sequence are 14, 30, 60, 30, 96, 576, ...
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
MATHEMATICA
seq = {}; s1 = s2 = 0; c = n = 0; p = prv = 2; While[c < 45, p = NextPrime[p]; If[p == prv + 2, n++; s1 += prv; s2 += p; If[PrimeQ[s1] && PrimeQ[s2], c++; AppendTo[seq, n]]]; prv = p]; seq (* Amiram Eldar, Jan 03 2020 *)
PROG
(PARI) t(n, p=3) = {while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2}
s1(n) = sum(k=1, n, t(k));
s2(n) = sum(k=1, n, t(k)+2);
for(n=1, 1e3, if(ispseudoprime(s1(n)) && ispseudoprime(s2(n)), print1(n, ", ")));
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 19 2016
EXTENSIONS
More terms from Amiram Eldar, Jan 03 2020
STATUS
approved