OFFSET
1,3
LINKS
Leisure Maths Entertainment Forum, 2 nonattacking rooks on n X n board, Chinese blog.
FORMULA
a(n) = (1/16)*n*(n^3-2n^2+6n-4) if n is even;
a(n) = (1/16)*(n-1)*(n^3-n^2+5n-1) if n is odd.
G.f.: -x^2*(x^2+1)*(x^2+x+1)/((x+1)^2*(x-1)^5). - Alois P. Heinz, Apr 26 2019
EXAMPLE
For n = 4 the a(4) = 13 solutions are
{{1,0,0,0}} {{1,0,0,0}} {{1,0,0,0}}
{{0,1,0,0}} {{0,0,1,0}} {{0,0,0,1}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,0}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,0}}
—————————————————————————————————————
{{1,0,0,0}} {{1,0,0,0}} {{1,0,0,0}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,0}}
{{0,0,1,0}} {{0,0,0,1}} {{0,0,0,0}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,1}}
—————————————————————————————————————
{{0,1,0,0}} {{0,1,0,0}} {{0,1,0,0}}
{{1,0,0,0}} {{0,0,1,0}} {{0,0,0,1}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,0}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,0}}
—————————————————————————————————————
{{0,1,0,0}} {{0,1,0,0}} {{0,1,0,0}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,0,0}}
{{0,0,1,0}} {{0,0,0,1}} {{0,0,0,0}}
{{0,0,0,0}} {{0,0,0,0}} {{0,0,1,0}}
—————————————————————————————————————
{{0,0,0,0}}
{{0,1,0,0}}
{{0,0,1,0}}
{{0,0,0,0}}
MATHEMATICA
Table[
Piecewise[{{(n (n^3 - 2 n^2 + 6 n - 4))/16, Mod[n, 2] == 0},
{((n - 1) (n^3 - n^2 + 5 n - 1))/16, Mod[n, 2] == 1}}], {n, 20}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mo Li, Apr 19 2019
STATUS
approved