A285188 a(n) = Sum_{k=1..n} (k^2*floor(k/2)).
0, 4, 13, 45, 95, 203, 350, 606, 930, 1430, 2035, 2899, 3913, 5285, 6860, 8908, 11220, 14136, 17385, 21385, 25795, 31119, 36938, 43850, 51350, 60138, 69615, 80591, 92365, 105865, 120280, 136664, 154088, 173740, 194565, 217893, 242535, 269971
Offset: 1
Examples
For n = 4, a(4) = 1^2*floor(1/2) + 2^2*floor(2/2) + 3^2*floor(3/2) + 4^2*floor(4/2) = 0 + 4 + 9 + 32 = 45.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (2,2,-6,0,6,-2,-2,1).
Programs
-
MATLAB
s = @(n) sum((1:n).^2.*floor((1:n)/2)); %summation handle function s_cf = @(n) 1/8*n^2*(n+1)^2 - 2/3*floor((n+1)/2)^3 + 1/6*floor((n+1)/2); %faster closed-form handle function
-
Maple
seq( n*(n+1)*(3*n^2+n-1+3*(-1)^n)/24, n=1..100); # Robert Israel, Apr 26 2017
-
PARI
a(n) = sum(k=1, n, k^2*(k\2)); \\ Michel Marcus, Apr 24 2017
Formula
Theorem: a(n) = (1/8)*n^2*(n+1)^2 - (2/3)*floor((n+1)/2)^3 + (1/6)*floor((n+1)/2).
From Chai Wah Wu, Apr 24 2017: (Start)
a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5) - 2*a(n-6) - 2*a(n-7) + a(n-8) for n > 8.
G.f.: x^2*(x^4 + 3*x^3 + 11*x^2 + 5*x + 4)/((1 - x)^5*(1 + x)^3). (End)
a(n) = n*(n+1)*(3*n^2+n-1+3*(-1)^n)/24. - Robert Israel, Apr 26 2017