OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Graph Cycle
Eric Weisstein's World of Mathematics, King Graph
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 12*n^2 - 34*n + 23 for n > 1. - Andrew Howroyd, Jun 19 2017
From Colin Barker, Mar 11 2019: (Start)
G.f.: x^2*(3 + 20*x + x^2) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 4. (End)
E.g.f.: exp(x)*(23 - 22*x + 12*x^2) - 23 - x. - Stefano Spezia, Aug 14 2022
MATHEMATICA
Table[If[n == 1, 0, 23 - 34 n + 12 n^2], {n, 20}]
Join[{0}, LinearRecurrence[{3, -3, 1}, {1, 3, 29}, {2, 20}]]
CoefficientList[Series[(-3 x - 20 x^2 - x^3)/(-1 + x)^3, {x, 0, 20}], x]
PROG
(PARI) a(n)=if(n, 12*n^2-10*n+1, 0) \\ Charles R Greathouse IV, Jun 19 2017
(PARI) concat(0, Vec(x^2*(3 + 20*x + x^2) / (1 - x)^3 + O(x^40))) \\ Colin Barker, Mar 11 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Jun 19 2017
STATUS
approved