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.

A116702 Number of permutations of length n which avoid the patterns 123, 3241.

Original entry on oeis.org

1, 2, 5, 13, 32, 74, 163, 347, 722, 1480, 3005, 6065, 12196, 24470, 49031, 98167, 196454, 393044, 786241, 1572653, 3145496, 6291202, 12582635, 25165523, 50331322, 100662944, 201326213, 402652777, 805305932, 1610612270, 3221224975, 6442450415, 12884901326
Offset: 1

Views

Author

Lara Pudwell, Feb 26 2006

Keywords

Comments

Also number of permutations of length n which avoid the patterns 321, 2314, 2431; or avoid the patterns 123, 2314, 2431, etc.

Programs

  • Mathematica
    LinearRecurrence[{5, -9, 7, -2}, {1, 2, 5, 13}, 33] (* Jean-François Alcover, Jan 09 2019 *)
  • PARI
    Vec(x*(1 - 3*x + 4*x^2 - x^3) / ((1 - x)^3*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Oct 19 2017

Formula

G.f.: x*(1 - 3*x + 4*x^2 - x^3) / ((1 - x)^3*(1 - 2*x)).
Binomial transform of [1, 1, 2, 3, 3, 3, 3, ...]. - Gary W. Adamson, Oct 23 2007
a(n+1) = -A000217(n+1) + 3*2^n - 1. - R. J. Mathar, Jan 12 2013
From Colin Barker, Oct 19 2017: (Start)
a(n) = 3*2^(n-1) + n - (n+1)*(2+n)/2.
a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4) for n > 4.
(End)

Extensions

Edited by N. J. A. Sloane, Mar 16 2008