A357723 Number of ways to place a non-attacking black king and white king on an n X n board, up to rotation and reflection.
0, 0, 0, 5, 21, 63, 135, 270, 462, 770, 1170, 1755, 2475, 3465, 4641, 6188, 7980, 10260, 12852, 16065, 19665, 24035, 28875, 34650, 40986, 48438, 56550, 65975, 76167, 87885, 100485, 114840, 130200, 147560, 166056, 186813, 208845, 233415, 259407, 288230, 318630
Offset: 0
Examples
For n=3, the a(3) = 5 solutions are ... ... ..b b.. .b. ... ..b ... ... ... w.b w.. w.. .w. .w.
Links
- Index entries for linear recurrences with constant coefficients, signature (2,2,-6,0,6,-2,-2,1).
Programs
-
PARI
a(n)=(n-2)*(n-1)*(n^2+3*n+n%2*2)\8 \\ Charles R Greathouse IV, Feb 02 2023
-
Python
a=(lambda n: ((n-2)*(n-1)*(n**2+3*n+n%2*2)//8))
Formula
a(n) = n^4/8 - (5/8)*n^2 + 1/2 if n is odd, else n^4/8 - (7/8)*n^2 + (3/4)*n.
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).
a(n) = n^4/8 - (3/4)*n^2 + (3/8)*n + 1/4 + (-(1/8)*n^2 + (3/8)*n - 1/4)*(-1)^n.
a(n) = (n^4 + (2*(n mod 2)-7)*n^2 + 6*(1-(n mod 2))*n + (n mod 2)*4)/8.
a(n) = (n-2)*(n-1)*(n^2 + 3*n + 2*(n mod 2))/8.
G.f.: x^3*(3*x^3 - 11*x^2 - 11*x - 5)/((x+1)^3*(x-1)^5).
E.g.f.: (x*(x^3 + 6*x^2 - 4)*cosh(x) + (x^4 + 6*x^3 + 2*x^2 + 4)*sinh(x))/8. - Stefano Spezia, Jan 28 2023
Comments