OFFSET
0,5
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
FORMULA
a(n) = n(n+2)/8 if n is even; a(n) = (n-1)^2/4 if n is odd (n>=0). - Emeric Deutsch, Nov 29 2006
a(n) = (3*n^2-2*n+2-(n^2-6*n+2)*(-1)^n)/16. - Luce ETIENNE, May 28 2015
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6) for n>5. - Colin Barker, May 28 2015
G.f.: -x^2*(x^3+x+1) / ((x-1)^3*(x+1)^3). - Colin Barker, May 28 2015
MAPLE
a:=proc(n) if n mod 2 = 0 then n*(n+2)/8 else (n-1)^2/4 fi end: seq(a(n), n=0..70); # Emeric Deutsch, Nov 29 2006
MATHEMATICA
tr=Table[{k(k+1)/2, k^2}, {k, 0, 100}]//Flatten (Seidov)
With[{nn=30}, Riffle[Accumulate[Range[0, nn]], Range[0, nn]^2]] (* Harvey P. Dale, Jul 13 2014 *)
PROG
(PARI) concat([0, 0], Vec(-x^2*(x^3+x+1)/((x-1)^3*(x+1)^3) + O(x^100))) \\ Colin Barker, May 28 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a suggestion from Robert G. Wilson v, Nov 27 2006
EXTENSIONS
More terms from Zak Seidov, Nov 28 2006
More terms from Emeric Deutsch, Nov 29 2006
STATUS
approved