OFFSET
0,3
COMMENTS
Number of permutations of {1,2,...,n+2} such that there are exactly two entries between the entries 1 and 2. Example: a(2)=4 because we have 1342, 1432, 2341 and 2431. - Emeric Deutsch, Apr 06 2008
a(n) = A138770(n+2). - Emeric Deutsch, Apr 06 2008
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..300
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 554
FORMULA
E.g.f.: 2*x^2/(-1+x)^2.
Recurrence: {a(1)=0, a(0)=0, a(2)=4, (-n^2-n)*a(n)+(n-1)*a(n+1)}.
MAPLE
spec := [S, {S=Prod(Z, Sequence(Z), Sequence(Z), Union(Z, Z))}, labeled]: seq(combstruct[count](spec, size=n), n=0..20);
PROG
(Magma) [0] cat [(2*n-2)*Factorial(n): n in [1..25]]; // Vincenzo Librandi, Oct 11 2011
(PARI) a(n)=(2*n-2)*n! \\ Charles R Greathouse IV, Nov 20 2011
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
STATUS
approved