OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Michael Dairyko, Lara Pudwell, Samantha Tyner, Casey Wynn, Non-contiguous pattern avoidance in binary trees. Electron. J. Combin. 19 (2012), no. 3, Paper 22, 21 pp. MR2967227.
Lara Pudwell, Systematic Studies in Pattern Avoidance, 2005.
Index entries for linear recurrences with constant coefficients, signature (4,-5,1,2,-1).
FORMULA
G.f.: -x*(x^4-x^3-2*x^2+2*x-1) / ((x^2+x-1)*(x-1)^3).
From Colin Barker, Oct 20 2017: (Start)
a(n) = -3 + (2^(-1- n)*((1-sqrt(5))^n*(-11+5*sqrt(5)) + (1+sqrt(5))^n*(11+5*sqrt(5)))) / sqrt(5) - n - (1 + n)*(2 + n)/2.
a(n) = 4*a(n-1) - 5*a(n-2) + a(n-3) + 2*a(n-4) - a(n-5) for n>5.
(End)
a(n) = 1 + Sum_{k=1..n} Sum_{j=1..k} Sum_{i=1..j-1} Fibonacci(i). - Ehren Metcalfe, Oct 22 2017
MATHEMATICA
LinearRecurrence[{4, -5, 1, 2, -1}, {1, 2, 5, 12, 26}, 40] (* Vincenzo Librandi, Oct 22 2017 *)
PROG
(PARI) Vec(x*(1 - 2*x + 2*x^2 + x^3 - x^4) / ((1 - x)^3*(1 - x - x^2)) + O(x^40)) \\ Colin Barker, Oct 20 2017
(Magma) I:=[1, 2, 5, 12, 26]; [n le 5 select I[n] else 4*Self(n-1)-5*Self(n-2)+Self(n-3)+2*Self(n-4)-Self(n-5): n in [1..40]]; // Vincenzo Librandi, Oct 22 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lara Pudwell, Feb 26 2006
STATUS
approved