cp's OEIS Frontend

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.

A245524 a(n) = n^2 - floor(n/2)*(-1)^n.

This page as a plain text file.
%I A245524 #37 Jun 20 2024 20:42:24
%S A245524 1,3,10,14,27,33,52,60,85,95,126,138,175,189,232,248,297,315,370,390,
%T A245524 451,473,540,564,637,663,742,770,855,885,976,1008,1105,1139,1242,1278,
%U A245524 1387,1425,1540,1580,1701,1743,1870,1914,2047,2093,2232,2280,2425,2475
%N A245524 a(n) = n^2 - floor(n/2)*(-1)^n.
%C A245524 Consider the partitions of 2n into two parts: When n is odd, a(n) gives the total sum of the even numbers from the smallest parts and the odd numbers from the largest parts of these partitions. When n is even, a(n) gives the total sum of the odd numbers from the smallest parts and the even numbers from the largest parts (see example).
%H A245524 Vincenzo Librandi, <a href="/A245524/b245524.txt">Table of n, a(n) for n = 1..1000</a>
%H A245524 <a href="/index/Par#part">Index entries for sequences related to partitions</a>
%H A245524 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F A245524 a(n) = (4*n^2 - 1 - (2*n - 1)*(-1)^n) / 4.
%F A245524 a(n) = A000290(n) - A001057(n-1), n > 0.
%F A245524 G.f.: x*(1+2*x+5*x^2)/((1+x)^2*(1-x)^3). - _Robert Israel_, Jul 25 2014
%F A245524 a(n) = (2*n-1)*(n-floor(n/2)). - _Wesley Ivan Hurt_, Jan 10 2017
%F A245524 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) = 27. - _Bruno Berselli_, May 23 2018
%F A245524 E.g.f.: (1/2)*(x*(2*x+3)*cosh(x) + (2*x^2+x-1)*sinh(x)). - _G. C. Greubel_, Mar 14 2024
%F A245524 a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). - _Wesley Ivan Hurt_, Jun 20 2024
%e A245524 a(3) = 10; The partitions of 2*3 = 6 into two parts are: (5,1), (4,2), (3,3). Since 3 is odd, we sum the even numbers from the smallest parts together with the odd numbers from the largest parts to get: (2) + (3+5) = 10.
%e A245524 a(4) = 14; 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 odd numbers from the smallest parts together with the even numbers from the largest parts to get: (1+3) + (4+6) = 14.
%p A245524 A245524:=n->n^2-floor(n/2)*(-1)^n: seq(A245524(n), n=1..50);
%t A245524 Table[n^2 - Floor[n/2] (-1)^n, {n, 50}]
%t A245524 CoefficientList[Series[(1 + 2 x + 5 x^2)/((1 + x)^2 (1 - x)^3), {x, 0, 50}], x] (* _Vincenzo Librandi_, Jul 25 2014 *)
%o A245524 (Magma) [n^2-Floor(n/2)*(-1)^n : n in [1..50]];
%o A245524 (SageMath) [n^2-(-1)^n*(n//2) for n in range(1,71)] # _G. C. Greubel_, Mar 14 2024
%Y A245524 Cf. A000290, A001057.
%K A245524 nonn,easy
%O A245524 1,2
%A A245524 _Wesley Ivan Hurt_, Jul 24 2014