login
Sums of successive twin primes of order 2.
1

%I #12 Sep 27 2022 09:00:35

%S 18,22,30,42,54,66,84,108,132,156,186,222,252,276,318,378,414,426,462,

%T 522,564,588,630,690,732,756,774,786,822,882,924,948,990,1050,1092,

%U 1116,1158,1218,1284,1356,1464,1608,1692,1716,1758,1818,1908,2028,2136,2232

%N Sums of successive twin primes of order 2.

%C Order here refers to the depth of the iterations in successive sums. Order 0 is the twin primes, order 1 is the sums of order 0, order 2 is the sums of order 1 etc.

%H Harvey P. Dale, <a href="/A096282/b096282.txt">Table of n, a(n) for n = 1..1000</a>

%e The twin prime quartet 3,5,5,7 has the first order sums 8,10,12 and the 2nd order sums 18,22 the first two terms in the sequence.

%t Total/@Partition[Total/@Partition[Flatten[Select[Partition[Prime[ Range[ 150]],2,1],#[[2]]-#[[1]]==2&]],2,1],2,1] (* _Harvey P. Dale_, Feb 16 2016 *)

%o (PARI) \\ Sums of successive twin primes. = terms, m = order of sums.

%o sucsumstw(n,m) = { local(a,b,i,j,k,p); a = vector(1001); b = vector(1001); p=1; forprime(j=3,n, if(isprime(j+2), a[p] = j; a[p+1] = j+2; p+=2; ) ); for(i=1,m, for(j=1,n+n, b[j] = a[j]+ a[j+1]; ); a=b; ); for(k=1,p-3, print1(a[k]", "); ) }

%K easy,nonn

%O 1,1

%A _Cino Hilliard_, Jun 23 2004

%E Corrected and extended by _Harvey P. Dale_, Feb 16 2016