[go: up one dir, main page]

login
A162968
Number of pairs of consecutive non-fixed points in all permutations of {1,2,...,n}.
0
1, 6, 42, 312, 2520, 22320, 216720, 2298240, 26490240, 330220800, 4430764800, 63707212800, 977642265600, 15953627289600, 275919291648000, 5042392363008000, 97102667870208000, 1965528727658496000, 41724269440229376000, 926935665115299840000
OFFSET
2,2
FORMULA
a(n) = (n-1)! * (n^2 - 3*n + 3) (n>=2).
a(n) = A001564(n-2)*(n-1) for n>=2. - Anton Zakharov, Sep 14 2016
D-finite with recurrence a(n) +(-n-5)*a(n-1) +(4*n-1)*a(n-2) +3*(-n+3)*a(n-3)=0. - R. J. Mathar, Jul 22 2022
EXAMPLE
a(3)=6 because in 123, 132, 213, 231, 312, 321 we have 0+1+1+2+2+0 such pairs.
MAPLE
seq(factorial(n-1)*(n^2-3*n+3), n = 2 .. 20);
MATHEMATICA
Table[(n-1)!(n^2-3n+3), {n, 2, 30}] (* Harvey P. Dale, Mar 28 2012 *)
CROSSREFS
Cf. A001564.
Sequence in context: A091164 A004982 A093388 * A247638 A034171 A264911
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Jul 19 2009
STATUS
approved