OFFSET
3,1
LINKS
Colin Barker, Table of n, a(n) for n = 3..1000
Index entries for linear recurrences with constant coefficients, signature (7,-21,35,-35,21,-7,1).
FORMULA
a(n) = n * (n^5 - 7*n^4 + 17*n^3 - 17*n^2 + 30*n - 24) / 48 for n>=3.
a(n) = C(n,2)*(C(n-2,2)*C(n-4,2)/6 + 1) + 2*C(n,3)*C(n-3,2) + 6*C(n,4) for n>=3.
G.f.: -x^3*(x^6-7*x^5+21*x^4-33*x^3+39*x^2-9*x+3) / (x-1)^7. - Colin Barker, Dec 30 2014
EXAMPLE
For n=4, the 12 permutations are 0132, 0213, 0321, 1023, 1230, 1302, 2031, 2103, 2310, 3012, 3120, and 3201. For example, 0123 is permuted into 0132 by ((b,d),(c,d), (b,c)).
PROG
(PARI) Vec(-x^3*(x^6-7*x^5+21*x^4-33*x^3+39*x^2-9*x+3)/(x-1)^7 + O(x^100)) \\ Colin Barker, Dec 30 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Andrew Woods, Dec 28 2014
EXTENSIONS
More terms from Colin Barker, Dec 30 2014
STATUS
approved