OFFSET
1,3
COMMENTS
A legal position is such that the kings are not on (horizontal, vertical or diagonal) neighboring squares.
For n < 3 this is not possible, for n >= 3 a king on the corner, border or elsewhere on the board takes away 4, 6 resp. 9 allowed squares from the n X n board, which yields the formula. - M. F. Hasler, Nov 17 2021
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
a(n) = n^4 - 9 n^2 + 12 n - 4.
G.f.: x^3*(8 - x - x^2)/(1 - x)^5. - Colin Barker, Jan 09 2013
a(n) = (n - 1) (n - 2) (n^2 + 3 n - 2). - M. F. Hasler, Nov 17 2021
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5) - Nathan L. Skirrow, Oct 11 2022
EXAMPLE
There are 32 ways of putting 2 distinct kings on a 3 X 3 board so that neither can capture the other.
From M. F. Hasler, Nov 17 2021: (Start)
The first nonzero term occurs for n = 3 where we have the possibilities
K x O x K x
x x O and x x x and rotations of these by +-90 degrees and 180 degrees,
O O O O O O
where 'x' are forbidden squares, and 'O' are squares the opposite king can be placed on. This yields the a(3) = 4*(5 + 3) = 32 possibilities. (End)
MATHEMATICA
CoefficientList[Series[4 x^2 (x^2 + x - 8)/(x - 1)^5, {x, 0, 40}], x] (* Vincenzo Librandi, Oct 20 2013 *)
PROG
(Magma) [n^4 - 9*n^2 + 12*n - 4: n in [1..40]]; // Vincenzo Librandi, Oct 20 2013
(PARI) apply( {A035286(n)=n^4-9*n^2+12*n-4}, [1..99]) \\ M. F. Hasler, Nov 17 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved