OFFSET
0,5
COMMENTS
Sum of the lengths of the distinct rectangles with odd length and integer width such that L + W = n, W <= L. For example, a(10) = 21; the rectangles are 1 X 9, 3 X 7 and 5 X 5, so 9 + 7 + 5 = 21. - Wesley Ivan Hurt, Nov 18 2017
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,2,-2,0,0,-1,1).
FORMULA
a(n) = a(n-1) + 2*a(n-4) - 2*a(n-5) - a(n-8) + a(n-9) for n > 8.
a(n) = (6*n^2 - 6*n + 1 + (10*n-5)*(-1)^n - (4*n - 2 - 2*(-1)^n)*(-1)^((2*n+1 - (-1)^n)/4))/32.
G.f.: x^2*(1 + x + x^2)*(1 - 2*x + 4*x^2 - 2*x^3 + x^4) / ((1-x)^3*(1+x)^2*(1+x^2)^2). - Colin Barker, Apr 22 2016
E.g.f.: ((-5*(1 + 2*x))*exp(-x) + (1 + 6*x^2)*exp(x) + 4*(1 + x)*cos(x) + 4*x*sin(x))/32. - Ilya Gutkovskiy, Apr 27 2016
a(n) = Sum_{i=1..floor(n/2)} (n-i) * ((n-i) mod 2). - Wesley Ivan Hurt, Dec 06 2017
EXAMPLE
a(5) = 3; the partitions of 5 into two parts are (4,1),(3,2) and the sum of the odd numbers among the larger parts is 3.
a(6) = 8; the partitions of 6 into two parts are (5,1),(4,2),(3,3) and the sum of the odd numbers among the larger parts is 5+3 = 8.
MAPLE
MATHEMATICA
Table[(6n^2-6n+1+(10n-5)(-1)^n-(4n-2-2(-1)^n)(-1)^((2n+1-(-1)^n)/4))/32, {n, 0, 100}]
Table[Total@ Flatten[First /@ IntegerPartitions[n, {2}] /. k_ /; EvenQ@ k -> Nothing], {n, 0, 60}] (* Michael De Vlieger, Apr 26 2016, Version 10.2 *)
f[n_] := Sum[(n - i) Mod[n - i, 2], {i, Floor[n/2]}]; Array[f, 58, 0] (* Robert G. Wilson v, Dec 11 2017 *)
CoefficientList[ Series[x^2 (1 +x +x^2) (1 -2x +4x^2 -2x^3 +x^4)/((1 -x)^3 (1 +x)^2 (1 +x^2)^2), {x, 0, 57}], x] (* Robert G. Wilson v, Dec 13 2017 *)
Table[Total[Select[IntegerPartitions[n, {2}][[All, 1]], OddQ]], {n, 0, 60}] (* Harvey P. Dale, Jun 29 2018 *)
PROG
(Magma) [(6*n^2-6*n+1+(10*n-5)*(-1)^n-(4*n-2-2*(-1)^n)*(-1)^((2*n+1-(-1)^n) div 4))/32: n in [0..100]];
concat(vector(2), Vec(x^2*(1+x+x^2)*(1-2*x+4*x^2-2*x^3+x^4)/((1-x)^3*(1+x)^2*(1+x^2)^2) + O(x^50))) \\ Colin Barker, Apr 23 2016
(PARI) a(n)=([0, 1, 0, 0, 0, 0, 0, 0, 0; 0, 0, 1, 0, 0, 0, 0, 0, 0; 0, 0, 0, 1, 0, 0, 0, 0, 0; 0, 0, 0, 0, 1, 0, 0, 0, 0; 0, 0, 0, 0, 0, 1, 0, 0, 0; 0, 0, 0, 0, 0, 0, 1, 0, 0; 0, 0, 0, 0, 0, 0, 0, 1, 0; 0, 0, 0, 0, 0, 0, 0, 0, 1; 1, -1, 0, 0, -2, 2, 0, 0, 1]^n*[0; 0; 1; 0; 3; 3; 8; 5; 12])[1, 1] \\ Charles R Greathouse IV, Apr 29 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 22 2016
STATUS
approved