OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Lara Pudwell, Systematic Studies in Pattern Avoidance, 2005.
Index entries for linear recurrences with constant coefficients, signature (6,-14,16,-9,2).
FORMULA
G.f.: x*(1 - 4*x + 7*x^2 - 6*x^3 + x^4) / ((1 - x)^4*(1 - 2*x)).
Row sums of triangle A134398. Also, binomial transform of [1, 1, 2, 2, 1, 1, 1, ...]. - Gary W. Adamson, Oct 23 2007
From Colin Barker, Oct 20 2017: (Start)
a(n) = (3*2^n + 2*n - 3*n^2 + n^3)/6.
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.
(End)
MAPLE
seq((3*2^n +2*n -3*n^2 +n^3)/6, n=1..40); # G. C. Greubel, Nov 29 2019
MATHEMATICA
Table[(3*2^n +2*n -3*n^2 +n^3)/6, {n, 40}] (* G. C. Greubel, Nov 29 2019 *)
PROG
(PARI) Vec(x*(1 -4*x +7*x^2 -6*x^3 +x^4)/((1-x)^4*(1-2*x)) + O(x^40)) \\ Colin Barker, Oct 20 2017
(PARI) vector(40, n, (3*2^n +2*n -3*n^2 +n^3)/6) \\ G. C. Greubel, Nov 29 2019
(Magma) [(3*2^n +2*n -3*n^2 +n^3)/6: n in [1..40]]; // G. C. Greubel, Nov 29 2019
(Sage) [(3*2^n +2*n -3*n^2 +n^3)/6 for n in (1..40)] # G. C. Greubel, Nov 29 2019
(GAP) List([1..40], n-> (3*2^n +2*n -3*n^2 +n^3)/6); # G. C. Greubel, Nov 29 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lara Pudwell, Feb 26 2006
STATUS
approved