OFFSET
1,4
LINKS
T. Mansour and A. Robertson, Refined restricted permutations avoiding subsets of patterns of length three, Annals of Combinatorics, 6, 2002, 407-418.
FORMULA
a(n) = n(n+6)/24 if n mod 6 = 0; (n^2-1)/24 if n mod 6 = 1 or 5; (n+2)(n+4)/24 if n mod 6 = 2 or 4; (n^2-9)/24 if n mod 6 = 3.
a(n) = A008731(n-2). O.g.f.: x^2/((1-x)^3(1+x)^2(1+x+x^2)). [R. J. Mathar, Aug 11 2008]
EXAMPLE
a(2)=1 because we have 12; a(3)=0 because no permutation of [3] can have exactly two fixed points; a(4)=2 because we have 1432 and 3214.
MAPLE
a:=proc(n) if n mod 6 = 0 then n*(n+6)/24 elif n mod 6 = 1 or n mod 6 = 5 then (n^2-1)/24 elif n mod 6 = 2 or n mod 6 = 4 then (n+2)*(n+4)/24 else (n^2-9)/24 fi end: seq(a(n), n=1..70);
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Nov 17 2005
STATUS
approved