login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166448 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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 02:28 EDT 2024. Contains 371782 sequences. (Running on oeis4.)