OFFSET
2,1
REFERENCES
R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 6.40.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..450
FORMULA
G.f.: E(x) - E(x(1-x)/(1+x)), where E(x) = Sum_{n>=0} n!*x^n.
a(n) = n! - Sum_{k=1..n} ((-1)^(n-k)*k!*Sum_{i=0..n-k} binomial(i+k-1, k-1)*binomial(k, n-i-k)), n > 0. - Vladimir Kruchinin, Sep 08 2010
D-finite with recurrence a(n) +2*(-n+1)*a(n-1) +(n^2-2*n-2)*a(n-2) +(-n^2+7*n-14)*a(n-3) -(n-3)*(n-5)*a(n-4) +(n-3)*(n-4)*a(n-5)=0. - R. J. Mathar, Jul 26 2022
EXAMPLE
a(4)=22 because 3142 and 2413 are the only permutations of 1,2,3,4 with no adjacent consecutive entries.
MAPLE
E:=x->sum(n!*x^n, n=0..35): G:=E(x)-E(x*(1-x)/(1+x)): Gser:=series(G, x=0, 30): seq(coeff(Gser, x, n), n=2..23);
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, May 05 2007
STATUS
approved