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 (7,-17,17,-7,1).
FORMULA
G.f.: x*(1 - 5*x + 9*x^2 - 4*x^3) / ((1 - x)*(1 - 3*x + x^2)^2).
From Colin Barker, Oct 19 2017: (Start)
a(n) = (1/25)*(2^(-n)*(25*2^n + sqrt(5)*(3-sqrt(5))^n - sqrt(5)*(3+sqrt(5))^n + 10*((3-sqrt(5))^n + (3+sqrt(5))^n)*n)).
a(n) = 7*a(n-1) - 17*a(n-2) + 17*a(n-3) - 7*a(n-4) + a(n-5) for n>5.
(End)
a(n) = 1 + (2*(n - 1)*Lucas(2*(n - 1)) - Fibonacci(2*(n - 1)))/5. - Ehren Metcalfe, Oct 22 2017
MATHEMATICA
LinearRecurrence[{7, -17, 17, -7, 1}, {1, 2, 6, 21, 72}, 80] (* Vincenzo Librandi, Oct 22 2017 *)
PROG
(PARI) Vec(x*(1 - 5*x + 9*x^2 - 4*x^3) / ((1 - x)*(1 - 3*x + x^2)^2) + O(x^40)) \\ Colin Barker, Oct 19 2017
(Magma) [1+(2*(n-1)*Lucas(2*(n-1))-Fibonacci(2*(n-1)))/5: n in [1..30]]; // Vincenzo Librandi, Oct 22 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lara Pudwell, Feb 26 2006
STATUS
approved