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”).

Sum of first n primes minus next prime.
3

%I #10 Oct 12 2015 17:20:18

%S -1,0,3,6,15,24,39,54,71,98,123,156,195,234,275,322,379,434,497,566,

%T 633,708,785,866,959,1058,1157,1262,1367,1466,1589,1714,1849,1978,

%U 2125,2270,2421,2580,2741,2908,3085,3256,3445,3634,3829,4016,4215,4434,4659,4884

%N Sum of first n primes minus next prime.

%H Bill McEachen, <a href="/A166448/b166448.txt">Table of n, a(n) for n = 1..20000</a>

%e 2-3=-1, 2+3-5=0, 2+3+5-7=3,..

%t Clear[lst,n,a,b]; a=0;lst={};Do[a+=Prime[n];b=a-Prime[n+1];AppendTo[lst,b],{n,5!}];lst

%t Module[{nn=60,prs},prs=Prime[Range[nn]];Accumulate[Take[prs,nn-1]]- Take[ prs,{2,nn}]] (* _Harvey P. Dale_, Oct 12 2015 *)

%o (PARI) A166448()={ summ=0; for (n=1, 500, p=prime(n); summ+=p;

%o write("b166448.txt", n, " ", (summ-prime(n+1)) )); \\end FOR }

%Y Cf. A007504

%K sign

%O 1,3

%A _Vladimir Joseph Stephan Orlovsky_, Oct 13 2009