login
Number of ways to place a non-attacking white and black queen on n X n chessboard.
2

%I #20 Sep 08 2022 08:44:52

%S 0,0,16,88,280,680,1400,2576,4368,6960,10560,15400,21736,29848,40040,

%T 52640,68000,86496,108528,134520,164920,200200,240856,287408,340400,

%U 400400,468000,543816,628488,722680,827080,942400,1069376,1208768

%N Number of ways to place a non-attacking white and black queen on n X n chessboard.

%H Vincenzo Librandi, <a href="/A035291/b035291.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).

%F a(n) = (3 n^4 - 10 n^3 + 9 n^2 - 2 n)/3.

%F Equals 4 * A052149(n-1). [_N. J. A. Sloane_, Feb 20 2005]

%F G.f.: 8*x^3*(2+x)/(1-x)^5. [_Colin Barker_, Apr 17 2012]

%e There are 16 ways of putting distinct queens on 3 X 3 so that neither can capture the other.

%t CoefficientList[Series[8*x^3*(2+x)/(1-x)^5,{x,0,40}],x] (* _Vincenzo Librandi_, Apr 22 2012 *)

%o (Magma) [(3*n^4-10*n^3+9*n^2-2*n)/3: n in [1..40]]; // _Vincenzo Librandi_, Apr 22 2012

%o (Magma) I:=[0, 0, 16, 88,280]; [n le 5 select I[n] else 5*Self(n-1)-10*Self(n-2)+10*Self(n-3)-5*Self(n-4)+Self(n-5): n in [1..40]]; // _Vincenzo Librandi_, Apr 22 2012

%K nonn,easy

%O 1,3

%A _Erich Friedman_