OFFSET
1,3
LINKS
D. C. Blest, Optimising Sums of Cubes of Integer Differences, Math. Gaz., Vol. 84, No. 501 (Nov., 2000), pp. 509-513.
FORMULA
a[ n ] = (Sum_{i=1}^{i=r} [ (n+1-2i)^3-(n-r)*r^3 ]) / 3 where r=floor((n+2)/4)).
a(n) = r*(n-r+1)*(n-r)*(n-r-1)/3, where r = floor((n+1)/4). - Vladeta Jovovic, Dec 22 2004
G.f.: 2*x^3*(1+2*x+3*x^2+4*x^3+7*x^4+4*x^5+3*x^6+2*x^7+x^8)/((1+x)^3*(1+x^2)^3*(1-x)^5). - Vladeta Jovovic, Dec 22 2004
MATHEMATICA
a[n_] := With[{r = Floor[(n+1)/4]}, r*(n-r+1)*(n-r)*(n-r-1)/3]; Array[a, 40] (* Jean-François Alcover, Sep 30 2016, after Vladeta Jovovic *)
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
David C Blest (D.Blest(AT)utas.edu.au)
STATUS
approved