|
|
A215928
|
|
a(n) = 2*a(n-1) + a(n-2) for n > 2, a(0) = a(1) = 1, a(2) = 2.
|
|
8
|
|
|
1, 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, 5741, 13860, 33461, 80782, 195025, 470832, 1136689, 2744210, 6625109, 15994428, 38613965, 93222358, 225058681, 543339720, 1311738121, 3166815962, 7645370045, 18457556052, 44560482149, 107578520350, 259717522849
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Number of 132-avoiding two-stack sortable permutations. See Theorem 2.2 of Egge and Mansour which gives a generating function equation P(x) = 1 + x + 2*x^2 + x*(P(x) - 1 - x) + x^2*(P(x) - 1) + x*(P(x) - 1 - x).
a(n) is the top left entry of the n-th power of any of the 3 X 3 matrices [1, 1, 1; 1, 1, 1; 0, 1, 0] or [1, 1, 0; 1, 1, 1; 1, 1, 0] or [1, 1, 1; 0, 0, 1; 1, 1, 1] or [1, 0, 1; 1, 0, 1; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 2*a(n-1) + a(n-2) for n > 2, a(0) = a(1) = 1, a(2) = 2.
G.f.: 1 / (1 - x / (1 - x / (1 - x / (1 + x)))) = (1 - x - x^2) / (1 - 2*x - x^2).
G.f.: 1/( 1 - (Sum_{k>=0} x*(x + x^2)^k) ) = 1/( 1 - (Sum_{k>=1} x/(1 - x^2))^k) ). - Joerg Arndt, Sep 30 2012
G.f.: 1 + Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(4*k + 2 + x)/( x*(4*k + 4 + x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 06 2013
|
|
EXAMPLE
|
G.f. = 1 + x + 2*x^2 + 5*x^3 + 12*x^4 + 29*x^5 + 70*x^6 + 169*x^7 + 408*x^8 + 985*x^9 + ...
|
|
MAPLE
|
f:= gfun:-rectoproc({a(n)=2*a(n-1)+a(n-2), a(0)=1, a(1)=1, a(2)=2}, a(n), remember):
|
|
MATHEMATICA
|
CoefficientList[Series[(1 - x - x^2)/(1 - 2 x - x^2), {x, 0, 30}], x] (* Vincenzo Librandi, May 14 2015 *)
|
|
PROG
|
(PARI) {a(n) = if( n<0, 0, polcoeff( 1 / (1 - x / (1 - x / (1 - x / (1 + x)))) + x * O(x^n), n))};
(Magma) [1] cat [ n le 2 select (n) else 2*Self(n-1)+Self(n-2): n in [1..35] ]; // Vincenzo Librandi, May 14 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|