OFFSET
1,3
COMMENTS
Consider the partitions of n into two parts (p,q). Then 2*a(n) represents the total volume of the family of rectangular prisms with dimensions p, q, and (p + q).
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,4,-4,-6,6,4,-4,-1,1).
FORMULA
a(n) = (n/2) * Sum_{i=1..floor(n/2)} i*(n - i).
a(n) = n*floor(n/2)*(1 + floor(n/2))*(3*n - 1 - 2*floor(n/2))/12.
From Bruno Berselli, Apr 13 2018: (Start)
O.g.f.: x^2*(1 + 2*x + 7*x^2 + 3*x^3 + 3*x^4)/((1 - x)^5*(1 + x)^4).
E.g.f.: x*(-3*(1 - exp(2*x))*exp(-x) + 3*(3 + 11*exp(2*x))*exp(-x)*x - 3*(1 - 9*exp(2*x))*exp(-x)*x^2 + 4*exp(x)*x^3)/96.
a(n) = n^2*(n*(4*n + 3) + 3*n*(-1)^n - 4)/96. Therefore:
a(n) = n^2*(2*n - 1)*(n + 2)/48 for n even; otherwise:
a(n) = n^2*(n - 1)*(n + 1)/24.
n^2*(4*n^2 + n - 1)*a(n+2) - 4*n^2*(n + 2)*a(n+1) - (n + 2)*(n + 3)*(4*n^2 + 9*n + 4)*a(n) = 0. (End)
MATHEMATICA
Table[n*Floor[n/2]*(1 + Floor[n/2])*(3 n - 1 - 2*Floor[n/2])/12, {n, 50}]
Table[n^2 (n (4 n + 3) + 3 n (-1)^n - 4)/96, {n, 1, 50}] (* Bruno Berselli, Apr 13 2018 *)
PROG
(PARI) vector(50, n, nn; n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96) \\ Bruno Berselli, Apr 13 2018
(Julia) [div(n^2*(n*(4*n+3)+3*n*(-1)^n-4), 96) for n in 1:50] |> println # Bruno Berselli, Apr 13 2018
(Sage) [n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96 for n in (1..50)] # Bruno Berselli, Apr 13 2018
(GAP) List([1..50], n -> n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96); # Bruno Berselli, Apr 13 2018
(Python) [n**2*(n*(4*n+3)+3*n*(-1)**n-4)/96 for n in range(1, 50)] # Bruno Berselli, Apr 13 2018
(Magma) [n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96: n in [1..50]]; // Bruno Berselli, Apr 13 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 12 2018
STATUS
approved