A086167 a(n) = sum of the first n lower twin primes.
3, 8, 19, 36, 65, 106, 165, 236, 337, 444, 581, 730, 909, 1100, 1297, 1524, 1763, 2032, 2313, 2624, 2971, 3390, 3821, 4282, 4803, 5372, 5971, 6588, 7229, 7888, 8697, 9518, 10345, 11202, 12083, 13102, 14133, 15182, 16243, 17334, 18485
Offset: 1
Keywords
Examples
For n = 4 we have twin prime pairs (3,5) (5,7) (11,13) (17,19) and 3 + 5 + 11 + 17 = 36.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
lst = {}; s = 0; Do[p = Prime[n]; If[PrimeQ[p + 2], s += p; AppendTo[lst, s]], {n, 6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Sep 30 2008 *) Accumulate[Transpose[Select[Partition[Prime[Range[200]], 2, 1], #[[2]] - #[[1]] == 2 &]][[1]]] (* Harvey P. Dale, Feb 02 2011 *)
-
PARI
addnexttwin(n)= { s=0; for(x=1,n, if(prime(x+1)-prime(x)==2,s=s+prime(x); print1(s",")) ) }