OFFSET
1,2
COMMENTS
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) = 1 + A014494(n-1).
G.f.: -x*(x^2+1)*(x^2+6*x+1) / ( (1+x)^2*(x-1)^3 ). - R. J. Mathar, Aug 25 2011
From Colin Barker, Jan 27 2016: (Start)
a(n) = (4*n^2+2*(-1)^n*n-4*n-(-1)^n+3)/2.
a(n) = 2*n^2-n+1 for n even.
a(n) = 2*n^2-3*n+2 for n odd.
(End)
MATHEMATICA
Select[Accumulate[Range[0, 100]], EvenQ]+1 (* or *) LinearRecurrence[{1, 2, -2, -1, 1}, {1, 7, 11, 29, 37}, 50] (* Harvey P. Dale, Nov 29 2014 *)
PROG
(PARI) Vec(-x*(x^2+1)*(x^2+6*x+1) / ((1+x)^2*(x-1)^3) + O(x^100)) \\ Colin Barker, Jan 27 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Aug 15 2011
STATUS
approved