OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1, 3, -3, -3, 3, 1, -1).
FORMULA
a(n)=a(n-1)+3a(n-2)-3a(n-3)-3a(n-4)+3a(n-5)+a(n-6)-a(n-7). G.f.: x*(1+x+6*x^2-2*x^3+x^4+x^5)/((1+x)^3*(x-1)^4). [From R. J. Mathar, Feb 22 2009]
MATHEMATICA
a = {}; r = 2; s = 0; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (*Artur Jasinski*)
nxt[{n_, a_}]:={n+1, If[EvenQ[n], a+(n+1)^2, a+1]}; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, Sep 05 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, May 12 2008
STATUS
approved