OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.:(1+13*x^4+14*x^3+46*x^2+6*x)/((1+x)^2*(1-x)^3) [From Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009]
From Ant King, Sep 01 2011: (Start)
a(n) = (1/8)*(1+(-1)^n+4*n)*(-1+5*(-1)^n+20*n)
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5)
a(n) = 80+2*a(n-2)-a(n-4)
(End)
MATHEMATICA
Table[1/8 (1+(-1)^n+4 n) (-1+5 (-1)^n+20 n), {n, 0, 42}] (* Ant King, Sep 01 2011 *)
Select[PolygonalNumber[7, Range[200]], OddQ] (* or *) LinearRecurrence[{1, 2, -2, -1, 1}, {1, 7, 55, 81, 189}, 50] (* Harvey P. Dale, Sep 14 2022 *)
PROG
(PARI) a(n)=(5*(-1)^n+20*n-1)*(4*n+1+(-1)^n)/8 \\ Charles R Greathouse IV, Sep 01 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Extended and description corrected by Patrick De Geest
STATUS
approved