The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A161570 Sum of all numbers from n up to A018252(n). 4

%I #10 Mar 05 2019 01:47:08

%S 1,9,18,30,35,40,57,77,84,91,116,144,153,162,195,205,215,225,235,275,

%T 318,330,342,354,366,416,429,442,497,555,570,585,648,664,680,696,712,

%U 782,799,816,833,850,927,1007,1026,1045,1064,1083,1170,1190,1210,1302

%N Sum of all numbers from n up to A018252(n).

%F a(n) = A000217(A018252(n)) - A000217(n-1).

%e a(2) = 2 + 3 + 4 = 9;

%e a(3) = 3 + 4 + 5 + 6 = 18;

%e a(4) = 4 + 5 + 6 + 7 + 8 = 30.

%p A018252 := proc(n) option remember ; if n = 1 then 1; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; fi; od: fi; end:

%p A000217 := proc(n) n*(n+1)/2 ; end:

%p A161570 := proc(n) A000217( A018252(n)) - A000217(n-1) ; end: seq(A161570(n),n=1..90) ; # _R. J. Mathar_, Aug 03 2009

%o (PARI) print1(n=1);p=3;forprime(q=5,97,for(k=p+1,q-1,print1(", "k*(k+1)/2-n++*(n-1)/2));p=q) \\ _Charles R Greathouse IV_, Sep 03 2011

%Y Cf. A018252, A000217.

%K nonn,easy

%O 1,2

%A _Juri-Stepan Gerasimov_, Jun 14 2009

%E a(26) corrected and extended by _R. J. Mathar_, Aug 03 2009

%E Definition rephrased by _R. J. Mathar_, Sep 11 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 June 10 10:32 EDT 2024. Contains 373264 sequences. (Running on oeis4.)