%I #21 Sep 08 2022 08:45:52
%S 3,5,11,19,37,41,113,149,163,281,421,541,547,607,661,691,739,823,827,
%T 941,991,1013,1019,1093,1249,1453,1549,1553,1583,1619,1733,1747,1951,
%U 2069,2153,2239,2399,2549,2609,2663,2687,2741,2777,2803,2833,2857,2861
%N Primes p such that the sum of next p primes is prime.
%C Primes p = prime(m) such that Sum_{k=1..p} prime(m+k) is prime. - Corrected by _Zak Seidov_, May 25 2017
%H Charles R Greathouse IV, <a href="/A175783/b175783.txt">Table of n, a(n) for n = 1..10000</a>
%H Zak Seidov, <a href="http://zak08.livejournal.com/23586.html">A175783</a>
%e a(1) = 3 because sum s of 3 primes after 3, s = 5+7+11 = 23, is prime.
%e a(2) = 5 because sum s of 5 primes after 5, s = 7+11+13+17+19 = 67, is prime.
%t Reap[Do[p = Prime[n]; If[PrimeQ[s = Sum[Prime[n + k], {k, p}]], Sow[p]], {n, 2, 1000}]][[2, 1]] (* corrected by _Zak Seidov_, May 25 2017 *)
%o (Magma) [p: i in [1..1000] | IsPrime(S) where S is &+[NthPrime(i+k): k in [1..p]] where p is NthPrime(i)]; // _Bruno Berselli_, May 25 2017
%o (PARI) list(lim)=my(v=List(),p=1,r=2,s=2,t); forprime(q=2,lim, s-=q; t=q-p+1; while(t, r=nextprime(r+1); s+=r; t--); if(isprime(s), listput(v,q)); p=q); Vec(v) \\ _Charles R Greathouse IV_, May 25 2017
%K nonn
%O 1,1
%A _Zak Seidov_, Sep 03 2010
|