cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A073684 Sum of next a(n) successive primes is prime.

This page as a plain text file.
%I A073684 #15 May 23 2025 14:30:50
%S A073684 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,
%T A073684 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,
%U A073684 7,3,33,3,3,5,3,15,3,5,9,7,13,5,11,3,3,11
%N A073684 Sum of next a(n) successive primes is prime.
%C A073684 Group the primes such that the sum of each group is a prime. Each group from the second onwards should contain at least 3 primes: (2, 3), (5, 7, 11), (13, 17, 19, 23, 29), (31, 37, 41), (43, 47, 53, 59, 61), ... Sequence gives number of terms in each group.
%H A073684 T. D. Noe, <a href="/A073684/b073684.txt">Table of n, a(n) for n = 1..10000</a>
%e A073684 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.
%t A073684 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 *)
%t A073684 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 *)
%o A073684 (Python)
%o A073684 from itertools import count, islice
%o A073684 from sympy import isprime, nextprime
%o A073684 def agen(): # generator of terms
%o A073684     s, i, p = 0, 1, 2
%o A073684     while True:
%o A073684         while not(isprime(s:=s+p)) or i < 2:
%o A073684             i, p = i+1, nextprime(p)
%o A073684         yield i
%o A073684         s, i, p = 0, 1, nextprime(p)
%o A073684 print(list(islice(agen(), 82))) # _Michael S. Branicky_, May 23 2025
%Y A073684 Cf. A073682(n) is the sum of terms in n-th group, A073683(n) is the first term in n-th group, A077279(n) is the last term in n-th group.
%K A073684 nonn
%O A073684 1,1
%A A073684 _Amarnath Murthy_, Aug 11 2002
%E A073684 More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 10 2003
%E A073684 Extended by _Ray Chandler_, May 02 2007