OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..450
Wikipedia, Permutation
EXAMPLE
a(6) = 665 = 720 - 55 counts all permutations of [6] with the exception of 15 permutations of type (12)(34)(56) and 40 permutations of type (123)(456).
MAPLE
b:= proc(n, i) option remember; `if`(n=0 or i=1, 1, add(`if`(
irem(j, i)=0 or irem(i, j)=0, b(n-i*j, i-1)*(i-1)!^j/j!
*combinat[multinomial](n, i$j, n-i*j), 0), j=0..n/i))
end:
a:= n-> b(n$2):
seq(a(n), n=0..25);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 04 2024
STATUS
approved