OFFSET
0,4
COMMENTS
(1/2) times number of permutations of 12...n such that exactly one of the following occurs: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).
Partial sums seem to be in A000239. - Ralf Stephan, Aug 28 2003
REFERENCES
F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
J. Riordan, A recurrence for permutations without rising or falling successions. Ann. Math. Statist. 36 (1965), 708-710.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
FORMULA
Coefficient of t^1 in S[n](t) defined in A002464, divided by 2.
a(n) ~ exp(-2) * n!. - Vaclav Kotesovec, Sep 11 2014
MAPLE
S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
[n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
-(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
end:
a:= n-> coeff(S(n), t, 1)/2:
seq(a(n), n=0..30); # Alois P. Heinz, Dec 21 2012
MATHEMATICA
S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t+2*t^2}[[n+1]], Expand[(n+1-t)*S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]]; a[n_] := Coefficient[S[n], t, 1]/2; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved