OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Nonagonal Number
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = (28*n^2 + 4*n + 1 + (14*n+1)*(-1)^n)/2.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n>4. - Colin Barker, May 30 2015
G.f.: -(19*x^4+20*x^3+64*x^2+8*x+1) / ((x-1)^3*(x+1)^2). - Colin Barker, May 30 2015
MATHEMATICA
Select[PolygonalNumber[9, Range[100]], OddQ] (* Requires Mathematica version 10 or later *) (* or *) LinearRecurrence[{1, 2, -2, -1, 1}, {1, 9, 75, 111, 261}, 50] (* Harvey P. Dale, Dec 27 2020 *)
PROG
(PARI) Vec(-(19*x^4+20*x^3+64*x^2+8*x+1)/((x-1)^3*(x+1)^2) + O(x^100)) \\ Colin Barker, May 30 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved