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.

A209256 Number of permutations of [n] that contain at least two fixed points in a succession.

Original entry on oeis.org

0, 0, 1, 1, 4, 18, 93, 579, 4165, 34031, 311528, 3158978, 35154907, 426029455, 5585287179, 78767551059, 1189090451364, 19133023344034, 326894939779865, 5910529926220115, 112753567098061553, 2263304875358959543, 47687055915645538384, 1052290471481700378570
Offset: 0

Views

Author

Jon Perry, Jan 14 2013

Keywords

Comments

A succession of a permutation p is the appearance of [k,k+1], e.g. in 23541, 23 is a succession.

Examples

			For n=4 we have 1234, 1243, 4231 and 2134 so a(4) = 4.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<6, [0, 0, 1, 1, 4, 18][n+1],
          ((2*n^3-43-17*n^2+47*n) *a(n-1)
           -(n-2)*(n^3-13*n^2+50*n-59) *a(n-2)
           -(n-3)*(3*n^3-28*n^2+82*n-78) *a(n-3)
           +(-219*n^2-4*n^4+49*n^3-305+425*n) *a(n-4)
           -(n-4)*(3*n^3-25*n^2+66*n-57) *a(n-5)
           -(n-4)*(n-5)*(n-2)^2 *a(n-6)) / (n-3)^2)
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 15 2013
  • Mathematica
    a[n_] := a[n] = If[n<6, {0, 0, 1, 1, 4, 18}[[n+1]],
         ((2n^3 - 43 - 17n^2 + 47n) a[n-1]
         -(n-2)(n^3 - 13n^2 + 50n - 59) a[n-2]
         -(n-3)(3n^3 - 28n^2 + 82n - 78) a[n-3]
         +(-219n^2 - 4n^4 + 49n^3 - 305 + 425n) a[n-4]
         -(n-4)(3n^3 - 25n^2 + 66n - 57) a[n-5]
         -(n-4)(n-5)(n-2)^2 a[n-6])/(n-3)^2];
    a /@ Range[0, 25] (* Jean-François Alcover, Mar 15 2021, after Alois P. Heinz *)

Formula

a(n) ~ (n-1)! * (1 - 3/(2*n) + 2/(3*n^2) + 47/(24*n^3) - 49/(120*n^4) - 6421/(720*n^5) - 17183/(1260*n^6)). - Vaclav Kotesovec, Mar 17 2015

Extensions

Extended beyond a(10) by Alois P. Heinz, Jan 15 2013