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.

A034962 Primes that are the sum of three consecutive primes.

This page as a plain text file.
%I A034962 #43 Dec 28 2022 01:57:19
%S A034962 23,31,41,59,71,83,97,109,131,173,199,211,223,251,269,311,349,439,457,
%T A034962 487,503,607,661,701,829,857,883,911,941,1033,1049,1061,1151,1187,
%U A034962 1229,1249,1303,1367,1381,1409,1433,1493,1511,1553,1667,1867,1931,1973,1993
%N A034962 Primes that are the sum of three consecutive primes.
%C A034962 Or, primes in A034961 (Sums of three consecutive primes). - _Zak Seidov_, Feb 16 2011
%H A034962 Zak Seidov, <a href="/A034962/b034962.txt">Table of n, a(n) for n = 1..10000</a>
%H A034962 Zak Seidov, <a href="/A034962/a034962.txt">Table of n, primepi(A073681(n)), primepi(A034962(n)), A073681(n), A152469(n), A152470(n), A034962(n) for n = 1..10000</a>
%H A034962 Zak Seidov, <a href="/A034962/a034962_1.txt">Table of a(1000*k) for k=1..1346. </a>
%e A034962 E.g., 131 = 41 + 43 + 47.
%e A034962 A034962(n) = p+q+r, where p = A073681(n), and p<q<r are three consecutive primes. - _Zak Seidov_, Mar 09 2009
%p A034962 a:=proc(n) if isprime(ithprime(n)+ithprime(n+1)+ithprime(n+2))=true then ithprime(n)+ithprime(n+1)+ithprime(n+2) else fi end: seq(a(n), n=1..120); # _Emeric Deutsch_, Apr 24 2006
%t A034962 a = {}; Do[k = Prime[x] + Prime[x + 1] + Prime[x + 2]; If[PrimeQ[k], AppendTo[a, k]], {x, 1, 350}]; a (* _Artur Jasinski_, Jan 27 2007 *)
%t A034962 Select[(Plus@@@Partition[Prime[Range[200]],3,1]),PrimeQ] (* _Zak Seidov_, Feb 07 2012 *)
%t A034962 Select[ListConvolve[{1,1,1},Prime[Range[200]]],PrimeQ] (* _Harvey P. Dale_, Jul 12 2013 *)
%o A034962 (PARI) forprime(p=2,1000, p2=nextprime(p+1); p3=nextprime(p2+1); q=p+p2+p3; if(isprime(q),print1(q",")) ) \\ _Max Alekseyev_, Jan 26 2007
%o A034962 (PARI) {p=2;q=3;for(n=1,100,r=nextprime(q+1); if(isprime(t=p+q+r),print1(t","));p=q;q=r;)} \\ _Zak Seidov_, Mar 09 2009
%o A034962 (Magma) [a: n in [1..150] | IsPrime(a) where a is NthPrime(n)+NthPrime(n+1)+NthPrime(n+2)]; // _Vincenzo Librandi_, Jun 23 2016
%o A034962 (Python)
%o A034962 from itertools import count, islice
%o A034962 from sympy import isprime, nextprime
%o A034962 def agen(): # generator of terms
%o A034962     p, q, r = 2, 3, 5
%o A034962     while True:
%o A034962         if isprime(p+q+r): yield p+q+r
%o A034962         p, q, r = q, r, nextprime(r)
%o A034962 print(list(islice(agen(), 50))) # _Michael S. Branicky_, Dec 27 2022
%Y A034962 Cf. A001043, A011974, A034707, A034961. Different from A050207.
%Y A034962 Cf. A073681 (smallest of three consecutive primes whose sum is a prime).
%K A034962 nonn
%O A034962 1,1
%A A034962 _Patrick De Geest_, Oct 15 1998