OFFSET
1,3
COMMENTS
Rotations and reflections of placements are not counted. If they are to be counted, see A061995.
LINKS
Heinrich Ludwig, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,2,-6,0,6,-2,-2,1).
FORMULA
a(n) = (n^4 - 2*n^2 - 4*n + IF(MOD(n, 2) = 1, 2*n^2 - 4*n + 7))/16.
a(n) = (2*n^4 - 2*n^2 - 12*n + 7 - (2*n^2 - 4*n + 7)*(-1)^n)/32. - Bruno Berselli, Dec 07 2016
a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5) - 2*a(n-6) - 2*a(n-7) + a(n-8).
From Colin Barker, Dec 07 2016: (Start)
a(n) = n*(n - 2)*(n^2 + 2*n + 2)/16 for n even.
a(n) = (n - 1)*(n^3 + n^2 + n - 7)/16 for n odd.
G.f.: x^3*(4 + 5*x + 3*x^2 - x^3 + x^4) / ((1 - x)^5*(1 + x)^3).
(End)
EXAMPLE
There are 4 non-equivalent ways to place 2 non-attacking kings on a 3 X 3 board:
K.K K.. K.. .K.
... ..K ... ...
... ... ..K .K.
MATHEMATICA
Table[(n^4 - 2 n^2 - 4 n + Boole[OddQ@ n] (2 n^2 - 4 n + 7))/16, {n, 43}] (* or *)
Rest@ CoefficientList[Series[x^3*(4 + 5 x + 3 x^2 - x^3 + x^4)/((1 - x)^5*(1 + x)^3), {x, 0, 43}], x] (* Michael De Vlieger, Dec 08 2016 *)
PROG
(PARI) concat(vector(2), Vec(x^3*(4 + 5*x + 3*x^2 - x^3 + x^4) / ((1 - x)^5*(1 + x)^3) + O(x^60))) \\ Colin Barker, Dec 07 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Heinrich Ludwig, Dec 06 2016
STATUS
approved