%I #26 Jan 17 2025 15:16:41
%S 0,4,26,92,240,520,994,1736,2832,4380,6490,9284,12896,17472,23170,
%T 30160,38624,48756,60762,74860,91280,110264,132066,156952,185200,
%U 217100,252954,293076,337792,387440,442370,502944,569536,642532
%N Number of ways to place 2 nonattacking bishops on an n X n board.
%D E. Bonsdorff, K. Fabel, O. Riihimaa, Schach und Zahl, 1966, p. 51-63
%H Vincenzo Librandi, <a href="/A172123/b172123.txt">Table of n, a(n) for n = 1..1000</a>
%H Christopher R. H. Hanusa, T Zaslavsky, S Chaiken, <a href="http://arxiv.org/abs/1609.00853">A q-Queens Problem. IV. Queens, Bishops, Nightriders (and Rooks)</a>, arXiv preprint arXiv:1609.00853, a12016
%H V. Kotesovec, <a href="https://oeis.org/wiki/User:Vaclav_Kotesovec">Number of ways of placing non-attacking queens and kings on boards of various sizes</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) = n*(n - 1)*(3*n^2 - n + 2)/6.
%F G.f.: -2*x^2*(x+1)*(x+2)/(x-1)^5. - _Vaclav Kotesovec_, Mar 25 2010
%F a(n) = 5*a(n-1)-10*a(n-2)+10*a(n-3)-5*a(n-4)+a(n-5). - _Vincenzo Librandi_, Apr 29 2013
%t CoefficientList[Series[-2 x (x+1)(x+2)/(x-1)^5, {x, 0, 80}], x] (* _Vincenzo Librandi_, Apr 29 2013 *)
%o (Magma) [n*(n-1)*(3*n^2-n+2)/6: n in [1..40]]; // _Vincenzo Librandi_, Apr 29 2013
%o (Magma) I:=[0, 4, 26, 92, 240]; [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 29 2013
%o (PARI) a(n)=n*(n-1)*(3*n^2-n+2)/6 \\ _Charles R Greathouse IV_, Jun 16 2015
%Y Cf. A036464.
%K nonn,easy
%O 1,2
%A _Vaclav Kotesovec_, Jan 26 2010