|
|
A285188
|
|
a(n) = Sum_{k=1..n} (k^2*floor(k/2)).
|
|
1
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
Theorem: a(n) = (1/8)*n^2*(n+1)^2 - (2/3)*floor((n+1)/2)^3 + (1/6)*floor((n+1)/2).
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
|
|
EXAMPLE
|
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.
|
|
MAPLE
|
seq( n*(n+1)*(3*n^2+n-1+3*(-1)^n)/24, n=1..100); # Robert Israel, Apr 26 2017
|
|
PROG
|
(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
(PARI) a(n) = sum(k=1, n, k^2*(k\2)); \\ Michel Marcus, Apr 24 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|