OFFSET
1,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..500
Index entries for linear recurrences with constant coefficients, signature (15,-84,226,-309,207,-54).
FORMULA
a(n) = 6^n - (2*n + 1)*3^n + n*(2*n + 1). - Andrew Howroyd, May 06 2020
From Colin Barker, Jul 16 2020: (Start)
G.f.: x^2*(1 + 33*x - 33*x^2 - 81*x^3) / ((1 - x)^3*(1 - 3*x)^2*(1 - 6*x)).
a(n) = 15*a(n-1) - 84*a(n-2) + 226*a(n-3) - 309*a(n-4) + 207*a(n-5) - 54*a(n-6) for n>6.
(End)
E.g.f.: x*(3+2*x)*exp(x) - (1+6*x)*exp(3*x) + exp(6*x). - G. C. Greubel, Jun 19 2022
MATHEMATICA
Table[6^n -(2*n+1)*3^n +n*(2*n+1), {n, 40}] (* G. C. Greubel, Jun 19 2022 *)
PROG
(PARI) a(n) = {6^n - (2*n + 1)*3^n + n*(2*n + 1)} \\ Andrew Howroyd, May 06 2020
(PARI) Vec(x^2*(1 + 33*x - 33*x^2 - 81*x^3) / ((1 - x)^3*(1 - 3*x)^2*(1 - 6*x)) + O(x^25)) \\ Colin Barker, Jul 16 2020
(Magma) [(&+[(-1)^j*Binomial(2*n+1, 2-j)*Binomial(j+2, 2)^n: j in [0..2]]): n in [1..40]]; // G. C. Greubel, Jun 19 2022
(SageMath) [6^n -(2*n+1)*3^n +binomial(2*n+1, 2) for n in (1..40)] # G. C. Greubel, Jun 19 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, May 29 2009
EXTENSIONS
Terms a(12) and beyond from Andrew Howroyd, May 06 2020
STATUS
approved