login
Maximum value of k^2 * (n-k).
2

%I #21 Sep 08 2022 08:45:57

%S 0,0,1,4,9,18,32,50,75,108,147,196,256,324,405,500,605,726,864,1014,

%T 1183,1372,1575,1800,2048,2312,2601,2916,3249,3610,4000,4410,4851,

%U 5324,5819,6348,6912,7500,8125,8788,9477,10206,10976,11774,12615,13500,14415,15376,16384,17424,18513,19652,20825,22050,23328,24642,26011,27436,28899,30420,32000

%N Maximum value of k^2 * (n-k).

%H G. C. Greubel, <a href="/A190798/b190798.txt">Table of n, a(n) for n = 0..5000</a>

%F a(n) = k^2 * (n-k), where k = round(2*n/3).

%F a(3*n) = 4*n^3, a(3*n-1) = n*(2*n-1)^2, a(3*n+1) = n*(2*n+1)^2.

%F O.g.f.: x^2*(1+x)^2*(1+x^2)/((1-x)^4*(1+x+x^2)^2).

%F a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - 4*a(n-4) + 2*a(n-5) - a(n-6) + 2*a(n-7) - a(n-8) for n >= 8.

%F a(-n) = -a(n). - _Michael Somos_, May 22 2011

%t CoefficientList[Series[x^2*(1+x)^2*(1+x^2)/((1-x)^4*(1+x+x^2)^2), {x, 0, 50}], x] (* _G. C. Greubel_, Aug 13 2018 *)

%o (PARI) a(n)=my(k=2*n\/3);k^2*(n-k) \\ _Charles R Greathouse IV_, May 20 2011

%o (Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); [0,0] cat Coefficients(R!(x^2*(1+x)^2*(1+x^2)/((1-x)^4*(1+x+x^2)^2))); // _G. C. Greubel_, Aug 13 2018

%Y Cf. A002620 (max of k * (n-k)).

%K nonn,easy

%O 0,4

%A _Franklin T. Adams-Watters_, May 20 2011