OFFSET
0,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..200
Vaclav Kotesovec, Non-attacking chess pieces, 6ed, 2013, p. 408.
FORMULA
a(n) = n*binomial(n^2-n-1,n-1) + n*(-1)^n, n > 1. - Vaclav Kotesovec, Oct 20 2011
MATHEMATICA
permopak[part_, k_]:=(hist=ConstantArray[0, k];
Do[hist[[part[[t]]]]++, {t, 1, Length[part]}];
(Length[part])!/Product[(hist[[t]])!, {t, 1, k}]);
waz1t[k_, n_]:=(If[n-k+1<k, 0, Binomial[n-k+1, k]-Binomial[n-k-1, k-2]]);
semiwazt[k_, n_]:=(psum=0;
Do[p=IntegerPartitions[k, {size}];
psum=psum+Sum[permopak[p[[i]], k]*Binomial[n, Length[p[[i]]]]*Product[waz1t[p[[i, j]], n], {j, 1, Length[p[[i]]]}], {i, 1, Length[p]}], {size, 1, n}]; psum);
Table[semiwazt[n, n], {n, 1, 25}]
Join[{1}, Table[n Binomial[n^2-n-1, n-1]+n (-1)^n, {n, 2, 20}]] (* Harvey P. Dale, Nov 24 2016 *)
PROG
(PARI) a(n) = if(n<=1, 1, n*binomial(n^2-n-1, n-1) + n*(-1)^n) \\ Andrew Howroyd, Mar 27 2023
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Vaclav Kotesovec, Oct 20 2011
EXTENSIONS
a(0)=1 prepended by Andrew Howroyd, Mar 27 2023
STATUS
approved