A172132 Number of ways to place 2 nonattacking knights on an n X n board.
0, 6, 28, 96, 252, 550, 1056, 1848, 3016, 4662, 6900, 9856, 13668, 18486, 24472, 31800, 40656, 51238, 63756, 78432, 95500, 115206, 137808, 163576, 192792, 225750, 262756, 304128, 350196, 401302, 457800, 520056, 588448, 663366
Offset: 1
References
- E. Bonsdorff, K. Fabel, O. Riihimaa, Schach und Zahl, 1966, p. 51-63
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- V. Kotesovec, Number of ways of placing non-attacking queens and kings on boards of various sizes
- Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
Programs
-
Magma
I:=[0, 6, 28, 96, 252]; [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 30 2013
-
Magma
[(n-1)*(n+4)*(n^2-3*n+4)/2: n in [1..40]]; // Vincenzo Librandi, Apr 30 2013
-
Mathematica
Table[(n-1)(n+4)(n^2 -3n +4)/2, {n, 40}] (* Vincenzo Librandi, Apr 30 2013 *)
-
SageMath
[(n-1)*(n+4)*(n^2-3*n+4)/2 for n in (1..40)] # G. C. Greubel, Apr 18 2022
Formula
a(n) = (n - 1)*(n + 4)*(n^2 - 3*n + 4)/2.
G.f.: 2*(12*x^4-39*x^3+37*x^2-20*x+4)/(x-1)^5. - Vaclav Kotesovec, Mar 25 2010
a(n) = 5*a(n-1)-10*a(n-2)+10*a(n-3)-5*a(n-4)+a(n-5). - Vincenzo Librandi, Apr 30 2013
E.g.f.: (1/2)*(16 + (-16 + 16*x - 2*x^2 + 6*x^3 + x^4)*exp(x)). - G. C. Greubel, Apr 18 2022