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 A245534 #24 Sep 08 2022 08:46:08 %S A245534 1,5,8,18,23,39,46,68,77,105,116,150,163,203,218,264,281,333,352,410, %T A245534 431,495,518,588,613,689,716,798,827,915,946,1040,1073,1173,1208,1314, %U A245534 1351,1463,1502,1620,1661,1785,1828,1958,2003,2139,2186,2328,2377,2525 %N A245534 a(n) = n^2 + floor(n/2)*(-1)^n. %C A245534 Consider the partitions of 2n into two parts: When n is odd, a(n) gives the total sum of the odd numbers from the smallest parts and the even numbers from the largest parts of these partitions. When n is even, a(n) gives the total sum of the even numbers from the smallest parts and the odd numbers from the largest parts (see example). %H A245534 <a href="/index/Par#part">Index entries for sequences related to partitions</a> %H A245534 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1). %F A245534 G.f.: x*(1 + 4*x + x^2 + 2*x^3)/((1 + x)^2*(1 - x)^3). %F A245534 a(n) = (4*n^2 + 1 + (2*n - 1)*(-1)^n)/4. %F A245534 a(n) = A000290(n) + A001057(n-1) for n > 0. %F A245534 a(n) = n^2 - Sum_{k=1..n-1} (-1)^k*k for n>1. Example: for n=5, a(5) = 5^2 - (4 - 3 + 2 - 1) = 23. - _Bruno Berselli_, May 23 2018 %e A245534 a(3) = 8; The partitions of 2*3 = 6 into two parts are: (5,1), (4,2), (3,3). Since 3 is odd, we sum the odd numbers from the smallest parts together with the even numbers from the largest parts to get: (1+3) + (4) = 8. %e A245534 a(4) = 18; The partitions of 4*2 = 8 into two parts are: (7,1), (6,2), (5,3), (4,4). Since 4 is even, we sum the even numbers from the smallest parts together with the odd numbers from the largest parts to get: (2+4) + (5+7) = 18. %p A245534 A245534:=n->n^2+floor(n/2)*(-1)^n: seq(A245534(n), n=1..50); %t A245534 Table[n^2 + Floor[n/2] (-1)^n, {n, 50}] %o A245534 (Magma) [n^2+Floor(n/2)*(-1)^n: n in [1..50]]; %o A245534 (PARI) a(n) = n^2 + (n\2)*(-1)^n; \\ _Michel Marcus_, Aug 06 2014 %Y A245534 Cf. A001057, A000290. See A245524 for a very similar sequence. %K A245534 nonn,easy %O A245534 1,2 %A A245534 _Wesley Ivan Hurt_, Jul 25 2014