A073684 Sum of next a(n) successive primes is prime.
2, 3, 5, 3, 5, 3, 3, 7, 9, 5, 9, 7, 3, 7, 5, 3, 3, 3, 5, 3, 3, 3, 5, 5, 57, 25, 49, 3, 9, 5, 11, 3, 5, 5, 5, 5, 17, 25, 3, 3, 5, 3, 7, 9, 5, 3, 3, 3, 15, 3, 3, 3, 3, 3, 3, 3, 15, 3, 5, 33, 5, 3, 3, 9, 7, 3, 33, 3, 3, 5, 3, 15, 3, 5, 9, 7, 13, 5, 11, 3, 3, 11
Offset: 1
Keywords
Examples
a(1)=2 because sum of first two primes 2+3 is prime; a(2)=3 because sum of next three primes 5+7+11 is prime; a(3)=5 because sum of next five primes 13+17+19+23+29 is prime.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
f[l_List] := Block[{n = Length[Flatten[l]], k = 3, r},While[r = Table[Prime[i], {i, n + 1, n + k}]; ! PrimeQ[Plus @@r], k += 2];Append[l, r]];Length /@ Nest[f, {{2, 3}}, 100] (* Ray Chandler, May 11 2007 *) cnt = 0; Table[s = Prime[cnt+1] + Prime[cnt+2]; len = 2; While[! PrimeQ[s], len++; s = s + Prime[cnt+len]]; cnt = cnt + len; len, {n, 100}] (* T. D. Noe, Feb 06 2012 *)
-
Python
from itertools import count, islice from sympy import isprime, nextprime def agen(): # generator of terms s, i, p = 0, 1, 2 while True: while not(isprime(s:=s+p)) or i < 2: i, p = i+1, nextprime(p) yield i s, i, p = 0, 1, nextprime(p) print(list(islice(agen(), 82))) # Michael S. Branicky, May 23 2025
Extensions
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 10 2003
Extended by Ray Chandler, May 02 2007
Comments