A052534 Expansion of (1-x)*(1+x)/(1-2*x-x^2+x^3).
1, 2, 4, 9, 20, 45, 101, 227, 510, 1146, 2575, 5786, 13001, 29213, 65641, 147494, 331416, 744685, 1673292, 3759853, 8448313, 18983187, 42654834, 95844542, 215360731, 483911170, 1087338529, 2443227497, 5489882353, 12335653674
Offset: 0
Examples
G.f. = 1 + 2*x + 4*x^2 + 9*x^3 + 20*x^4 + 45*x^5 + 101*x^6 + 227*x^7 + 510*x^8 + ... - _Michael Somos_, Dec 12 2023
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Jean-Luc Baril, Rigoberto Flórez, and José L. Ramírez, Counting symmetric and asymmetric peaks in motzkin paths with air pockets, Univ. Bourgogne (France, 2023).
- Nicolas Bělohoubek and Antonín Slavík, L-Tetromino Tilings and Two-Color Integer Compositions, Univ. Karlova (Czechia, 2025). See p. 10.
- C. P. de Andrade, J. P. de Oliveira Santos, E. V. P. da Silva and K. C. P. Silva, Polynomial Generalizations and Combinatorial Interpretations for Sequences Including the Fibonacci and Pell Numbers, Open Journal of Discrete Mathematics, 2013, 3, 25-32 doi:10.4236/ojdm.2013.31006. - From _N. J. A. Sloane_, Feb 20 2013
- E. S. Egge, Restricted 3412-Avoiding Involutions: Continued Fractions, Chebyshev Polynomials and Enumerations, arXiv:math/0307050 [math.CO], 2003, sec. 8.
- Rigoberto Flórez and José L. Ramírez, Some enumerations on non-decreasing Motzkin paths, Australasian J. of Combinatorics (2018) Vol. 72(1), 138-154.
- Jia Huang, Partially Palindromic Compositions, J. Int. Seq. (2023) Vol. 26, Art. 23.4.1. See p. 15.
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 464
- S. Morier-Genoud, V. Ovsienko, and S. Tabachnikov, Introducing supersymmetric frieze patterns and linear difference operators, Math. Z. 281 (2015) 1061.
- Alexey Ustinov, Supercontinuants, arXiv:1503.04497 [math.NT], 2015.
- R. Witula, D. Slota and A. Warzynski, Quasi-Fibonacci Numbers of the Seventh Order, J. Integer Seq., 9 (2006), Article 06.4.3.
- Index entries for linear recurrences with constant coefficients, signature (2,1,-1).
Programs
-
GAP
a:=[1,2,4];; for n in [4..40] do a[n]:=2*a[n-1]+a[n-2]-a[n-3]; od; a; # G. C. Greubel, May 09 2019
-
Magma
[n le 3 select 2^(n-1) else 2*Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Mar 17 2015
-
Maple
spec := [S,{S=Sequence(Union(Z,Prod(Z,Sequence(Prod(Z,Z)))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
-
Mathematica
LinearRecurrence[{2,1,-1},{1,2,4},40] (* Roman Witula, Aug 07 2012 *) CoefficientList[Series[(1-x^2)/(1-2x-x^2+x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 17 2015 *) a[ n_] := {0, 1, 0} . MatrixPower[{{1, 1, 1}, {1, 1, 0}, {1, 0, 0}}, n+1] . {0, 1, 0}; (* Michael Somos, Dec 12 2023 *)
-
Maxima
h(n):=if n=0 then 1 else sum(sum(binomial(k,j)*binomial(j,n-3*k+2*j)*2^(3*k-n-j)*(-1)^(k-j),j,0,k),k,1,n); a(n):=if n<2 then h(n) else h(n)-h(n-2); /* Vladimir Kruchinin, Sep 09 2010 */
-
PARI
my(x='x+O('x^40)); Vec((1-x^2)/(1-2*x-x^2+x^3)) \\ G. C. Greubel, May 09 2019
-
PARI
{a(n) = [0, 1, 0] * [1, 1, 1; 1, 1, 0; 1, 0, 0]^(n+1) * [0, 1, 0]~}; /* Michael Somos, Dec 12 2023 */
-
SageMath
((1-x^2)/(1-2*x-x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 09 2019
Formula
G.f.: (1 - x^2)/(1 - 2*x - x^2 + x^3).
a(n) = 2*a(n-1) + a(n-2) - a(n-3), with a(0)=1, a(1)=2, a(2)=4.
a(n) = Sum_{alpha = RootOf(1-2*x-x^2+x^3)} (1/7)*(2 + alpha)*alpha^(-1-n).
a(n) = central term in the (n+1)-th power of the 3 X 3 matrix (shown in the example of A066170): [1 1 1 / 1 1 0 / 1 0 0]. E.g. a(6) = 101 since the central term in M^7 = 101. - Gary W. Adamson, Feb 01 2004
a(n) = A077998(n+2) - 2*A006054(n+2), which implies 7*a(n-2) = (2 + c(4) - 2*c(2))*(1 + c(1))^n + (2 + c(1) - 2*c(4))*(1 + c(2))^n + (2 + c(2) - 2*c(1))*(1 + c(4))^n, where c(j)=2*Cos(2Pi*j/7), a(-2)=a(-1)=1 since A077998 and A006054 are equal to the respective quasi-Fibonacci numbers. [Witula, Slota and Warzynski] - Roman Witula, Aug 07 2012
a(n) = A028495(-1-n) for all n in Z. - Michael Somos, Dec 12 2023
Comments