login
a(n) = n^2*(n*(4*n + 3) + 3*n*(-1)^n - 4)/96.
2

%I #23 Sep 08 2022 08:46:21

%S 0,1,3,14,25,66,98,200,270,475,605,966,1183,1764,2100,2976,3468,4725,

%T 5415,7150,8085,10406,11638,14664,16250,20111,22113,26950,29435,35400,

%U 38440,45696,49368,58089,62475,72846,78033,90250,96330,110600,117670,134211,142373,161414

%N a(n) = n^2*(n*(4*n + 3) + 3*n*(-1)^n - 4)/96.

%C 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).

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1,4,-4,-6,6,4,-4,-1,1).

%F a(n) = (n/2) * Sum_{i=1..floor(n/2)} i*(n - i).

%F a(n) = n*floor(n/2)*(1 + floor(n/2))*(3*n - 1 - 2*floor(n/2))/12.

%F From _Bruno Berselli_, Apr 13 2018: (Start)

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

%F 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.

%F a(n) = n^2*(n*(4*n + 3) + 3*n*(-1)^n - 4)/96. Therefore:

%F a(n) = n^2*(2*n - 1)*(n + 2)/48 for n even; otherwise:

%F a(n) = n^2*(n - 1)*(n + 1)/24.

%F 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)

%t Table[n*Floor[n/2]*(1 + Floor[n/2])*(3 n - 1 - 2*Floor[n/2])/12, {n, 50}]

%t Table[n^2 (n (4 n + 3) + 3 n (-1)^n - 4)/96, {n, 1, 50}] (* _Bruno Berselli_, Apr 13 2018 *)

%o (PARI) vector(50, n, nn; n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96) \\ _Bruno Berselli_, Apr 13 2018

%o (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

%o (Sage) [n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96 for n in (1..50)] # _Bruno Berselli_, Apr 13 2018

%o (GAP) List([1..50], n -> n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96); # _Bruno Berselli_, Apr 13 2018

%o (Python) [n**2*(n*(4*n+3)+3*n*(-1)**n-4)/96 for n in range(1, 50)] # _Bruno Berselli_, Apr 13 2018

%o (Magma) [n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96: n in [1..50]]; // _Bruno Berselli_, Apr 13 2018

%Y Cf. A302647.

%Y First bisection is A180324.

%Y After 0, subsequence of A107972.

%K nonn,easy

%O 1,3

%A _Wesley Ivan Hurt_, Apr 12 2018