A077278 Duplicate of A073683.
2, 5, 13, 31, 43, 67, 79, 97, 131, 179, 199, 257, 293, 313, 359, 389, 409, 431, 443, 467
Offset: 1
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.
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.
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 *)
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
a(1)=5 because sum of first two primes 2+3 = 5 is prime; a(2)=23 because sum of next three primes 5+7+11 = 23 is prime; a(3)=101 because sum of next five primes 13+17+19+23+29 = 101 is prime.
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 s s, i, p = 0, 1, nextprime(p) print(list(islice(agen(), 42))) # Michael S. Branicky, May 23 2025
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 p s, i, p = 0, 1, nextprime(p) print(list(islice(agen(), 48))) # Michael S. Branicky, May 23 2025
Comments