This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A161570 #10 Mar 05 2019 01:47:08 %S A161570 1,9,18,30,35,40,57,77,84,91,116,144,153,162,195,205,215,225,235,275, %T A161570 318,330,342,354,366,416,429,442,497,555,570,585,648,664,680,696,712, %U A161570 782,799,816,833,850,927,1007,1026,1045,1064,1083,1170,1190,1210,1302 %N A161570 Sum of all numbers from n up to A018252(n). %F A161570 a(n) = A000217(A018252(n)) - A000217(n-1). %e A161570 a(2) = 2 + 3 + 4 = 9; %e A161570 a(3) = 3 + 4 + 5 + 6 = 18; %e A161570 a(4) = 4 + 5 + 6 + 7 + 8 = 30. %p A161570 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 A161570 A000217 := proc(n) n*(n+1)/2 ; end: %p A161570 A161570 := proc(n) A000217( A018252(n)) - A000217(n-1) ; end: seq(A161570(n),n=1..90) ; # _R. J. Mathar_, Aug 03 2009 %o A161570 (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 A161570 Cf. A018252, A000217. %K A161570 nonn,easy %O A161570 1,2 %A A161570 _Juri-Stepan Gerasimov_, Jun 14 2009 %E A161570 a(26) corrected and extended by _R. J. Mathar_, Aug 03 2009 %E A161570 Definition rephrased by _R. J. Mathar_, Sep 11 2009