login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Prime numbers p for which there exists an integer q > p such that the sum of all primes <= p equals the sum of all primes between p+1 and q.
1

%I #22 Aug 25 2023 12:04:07

%S 3,3833,468872968241

%N Prime numbers p for which there exists an integer q > p such that the sum of all primes <= p equals the sum of all primes between p+1 and q.

%C Primes p such that 2*A034387(p) is a term of A034387. - _Max Alekseyev_, Aug 24 2023

%C No other terms below 10^13. - _Max Alekseyev_, Aug 25 2023

%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_018.htm">Puzzle 18.- Some special sums of consecutive primes</a>, The Prime Puzzles & Problems Connection. See specifically the large solution by Giovanni Resta.

%e 2+3+5+...+3833 = 3847+...+5557 and therefore 3833 is in the sequence.

%t a[m_] := Module[{pLst, cumsum, p, q, k, target, idx}, pLst = Prime[Range[PrimePi[m]]]; cumsum = Accumulate[pLst]; pairs = {}; For[k = 1, k <= Length[pLst], k++, p = pLst[[k]]; target = 2*cumsum[[k]]; idx = FirstPosition[Drop[cumsum, k], target]; If[idx =!= Missing["NotFound"], q = pLst[[k + First[idx]]]; If[q > p, AppendTo[pairs, p];]]]; pairs]; a[10000] (* _Robert P. P. McKone_, Aug 25 2023 *)

%o (PARI) p=2;s=2;q=3;t=3;while(p<512345678900, while(s<=t,p=nextprime(p+1);s=s+p;t=t-p);if (s==t,print1(p,", "),);while(t<s,q=nextprime(q+1);t=t+q);if(s==t,print1(p,", "),))

%K more,nonn,bref

%O 1,1

%A _Randy L. Ekl_, Jan 10 2004

%E Better definition from Adam M. Kalman (mocha(AT)clarityconnect.com), Jun 16 2005

%E Edited by _Max Alekseyev_, Aug 24 2023