A089895 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.
3, 3833, 468872968241
Offset: 1
Examples
2+3+5+...+3833 = 3847+...+5557 and therefore 3833 is in the sequence.
Links
- Carlos Rivera, Puzzle 18.- Some special sums of consecutive primes, The Prime Puzzles & Problems Connection. See specifically the large solution by Giovanni Resta.
Programs
-
Mathematica
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 *)
-
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
Extensions
Better definition from Adam M. Kalman (mocha(AT)clarityconnect.com), Jun 16 2005
Edited by Max Alekseyev, Aug 24 2023
Comments