cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A165530 Number of permutations of length n which avoid the patterns 4321 and 3142.

Original entry on oeis.org

1, 1, 2, 6, 22, 86, 338, 1314, 5046, 19190, 72482, 272530, 1021734, 3823622, 14293234, 53394370, 199382550, 744348822, 2778471490, 10370520178, 38705706374, 144456761766, 539130777874, 2012086272674, 7509256255862, 28025026831158, 104591035618146
Offset: 0

Views

Author

Vincent Vatter, Sep 21 2009

Keywords

Examples

			There are 22 permutations of length 4 which avoid these two patterns, so a(4)=22.
		

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x)*(1-3*x)^2/((1-2*x)^2*(1-4*x+x^2)))); // G. C. Greubel, Oct 22 2018
  • Mathematica
    CoefficientList[Series[(1-x)*(1-3*x)^2/((1-2*x)^2*(1-4*x+x^2)), {x, 0, 50}], x] (* G. C. Greubel, Oct 22 2018 *)
  • PARI
    Vec((1 - x)*(1 - 3*x)^2 / ((1 - 2*x)^2*(1 - 4*x + x^2)) + O(x^30)) \\ Colin Barker, Oct 31 2017
    

Formula

G.f.: (1 - x)*(1 - 3*x)^2 / ((1 - 2*x)^2*(1 - 4*x + x^2)).
From Colin Barker, Oct 31 2017: (Start)
a(n) = (1/18)*(2*(3*2^n - (-3+sqrt(3))*(2+sqrt(3))^n + (2-sqrt(3))^n*(3+sqrt(3))) - 3*2^n*n).
a(n) = 8*a(n-1) - 21*a(n-2) + 20*a(n-3) - 4*a(n-4) for n>3.
(End)

Extensions

a(0)=1 prepended by Alois P. Heinz, Dec 09 2015