OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..200
Eric Weisstein's World of Mathematics, Graph Path
Eric Weisstein's World of Mathematics, Ladder Graph
Index entries for linear recurrences with constant coefficients, signature (6,-14,16,-9,2).
FORMULA
a(n) = 18*(2^n - 1) - n*(n^2 + 9*n + 41)/3. - Eric W. Weisstein, Jun 30 2017
a(n) = 6*a(n-1)-14*a(n-2)+16*a(n-3)-9*a(n-4)+2*a(n-5) for n > 5.
G.f.: x*(1+6*x-9*x^2+4*x^3)/((1-x)^4*(1-2*x)).
a(n) = 18*(2^n-1) - (41*n)/3 - 3*n^2 - n^3/3. - Colin Barker, Jun 11 2017
MATHEMATICA
Table[18 (2^n - 1) - n (n^2 + 9 n + 41)/3, {n, 20}] (* Eric W. Weisstein, Jun 30 2017 *)
LinearRecurrence[{6, -14, 16, -9, 2}, {1, 12, 49, 146, 373}, 20] (* Eric W. Weisstein, Jun 30 2017 *)
CoefficientList[Series[(-1 - 6 x + 9 x^2 - 4 x^3)/((-1 + x)^4 (-1 + 2 x)), {x, 0, 20}], x] (* Eric W. Weisstein, Jun 30 2017 *)
PROG
(PARI) Vec((1+6*x-9*x^2+4*x^3)/((1-x)^4*(1-2*x))+O(x^25))
(PARI) a(n) = 18*(2^n - 1) - n*(n^2 + 9*n + 41)/3 \\ Charles R Greathouse IV, Jun 30 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Andrew Howroyd, Jun 10 2017
STATUS
approved