OFFSET
1,1
COMMENTS
This can also be defined as integer averages of the first k halved squares, 1^2/2, 2^2/2, 3^2/2,... , 3^k/2, because sum_{j=1..k} j^2/2 = k*(k+1)*(2k+1)/12. The generating k are in A168489.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = +a(n-1) +2*a(n-2) -2*a(n-3) -a(n-4) +a(n-5). G.f. x*(-10-13*x-22*x^2-3*x^3) / ((1+x)^2*(x-1)^3). - R. J. Mathar, Jan 25 2011
From Colin Barker, Jan 26 2016: (Start)
a(n) = (24*n^2+6*n-(-1)^n*(8*n+1)+1)/4.
a(n) = (12*n^2-n)/2 for n even.
a(n) = (12*n^2+7*n+1)/2 for n odd.
(End)
MATHEMATICA
s=0; lst={}; Do[a=(s+=(n^2)/2)/n; If[Mod[a, 1]==0, AppendTo[lst, a]], {n, 2*6!}]; lst
Select[Table[((n+1)(2n+1))/12, {n, 300}], IntegerQ] (* or *) LinearRecurrence[ {1, 2, -2, -1, 1}, {10, 23, 65, 94, 168}, 60] (* Harvey P. Dale, Jun 14 2017 *)
PROG
(PARI) Vec(x*(10+13*x+22*x^2+3*x^3)/((1-x)^3*(1+x)^2) + O(x^100)) \\ Colin Barker, Jan 26 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Joseph Stephan Orlovsky, Aug 16 2009
STATUS
approved