A302758 a(n) = n^2*(n*(4*n + 3) + 3*n*(-1)^n - 4)/96.
0, 1, 3, 14, 25, 66, 98, 200, 270, 475, 605, 966, 1183, 1764, 2100, 2976, 3468, 4725, 5415, 7150, 8085, 10406, 11638, 14664, 16250, 20111, 22113, 26950, 29435, 35400, 38440, 45696, 49368, 58089, 62475, 72846, 78033, 90250, 96330, 110600, 117670, 134211, 142373, 161414
Offset: 1
Links
- Index entries for sequences related to partitions.
- Index entries for linear recurrences with constant coefficients, signature (1,4,-4,-6,6,4,-4,-1,1).
Programs
-
GAP
List([1..50], n -> 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
-
Magma
[n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96: n in [1..50]]; // Bruno Berselli, Apr 13 2018
-
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 *)
-
PARI
vector(50, n, nn; 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
-
Sage
[n^2*(n*(4*n+3)+3*n*(-1)^n-4)/96 for n in (1..50)] # Bruno Berselli, Apr 13 2018
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)
Sum_{n>=2} 1/a(n) = 156/5 - 48*Pi/5 - 4*Pi^2 + 288*log(2)/5. - Amiram Eldar, Jun 20 2025
Comments