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 A352116 #43 Feb 12 2023 12:30:52 %S A352116 1,4,19,40,85,140,231,336,489,660,891,1144,1469,1820,2255,2720,3281, %T A352116 3876,4579,5320,6181,7084,8119,9200,10425,11700,13131,14616,16269, %U A352116 17980,19871,21824,23969,26180,28595,31080,33781,36556,39559,42640,45961,49364,53019,56760,60765 %N A352116 Partial sums of the odd triangular numbers (A014493). %H A352116 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1). %F A352116 a(n) = Sum_{k=1..n} A014493(k) = Sum_{k=1..n} (2*k-1)(2*k-1-(-1)^k)/2. %F A352116 a(n) = A352115(n-1) + (-1)^(n-1)*n. %F A352116 a(n) = A000447(n) - A352115(n-1). %F A352116 From _Stefano Spezia_, Mar 05 2022: (Start) %F A352116 a(n) = n*(4*n^2 - 1 - 3*(-1)^n)/6. %F A352116 G.f.: x*(1 + 2*x + 10*x^2 + 2*x^3 + x^4)/((1 - x)^4*(1 + x)^2). (End) %e A352116 a(1) = 1 because 1 is the first odd term in A000027. %e A352116 a(2) = 1 + 3 = 4, the sum of the first two odd terms in A000027, and so on. %t A352116 LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 4, 19, 40, 85, 140}, 50] (* _Amiram Eldar_, Mar 05 2022 *) %o A352116 (PARI) to(n) = (2*n-1)*(2*n-1-(-1)^n)/2; \\ A014493 %o A352116 a(n) = sum(k=1, n, to(k)); \\ _Michel Marcus_, Mar 05 2022 %o A352116 (Python) %o A352116 def A352116(n): return n*((n-1)<<1)*(n+1)//3 + n*(n&1) # _Chai Wah Wu_, Feb 12 2023 %Y A352116 Cf. A001477, A000217, A000292, A014493, A014494, A352115, A000447. %K A352116 nonn,easy %O A352116 1,2 %A A352116 _David James Sycamore_, Mar 05 2022 %E A352116 More terms from _Michel Marcus_, Mar 05 2022