OFFSET
1,4
COMMENTS
In other words, a(n) is the graph diameter of the n X n knight graph (or -1 if the graph is disconnected). - Eric W. Weisstein, Nov 20 2019
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Marco Ripà, Metric spaces in chess and international chess pieces graph diameters, arXiv:2311.00016 [math.HO], 2023. See pp. 11, 19.
Paul B. Slater, Formulas for Generalized Two-Qubit Separability Probabilities, arXiv:1609.08561 [quant-ph], 2016.
Paul B. Slater, Hypergeometric/Difference-Equation-Based Separability Probability Formulas and Their Asymptotics for Generalized Two-Qubit States Endowed with Random Induced Measure, arXiv preprint arXiv:1504.04555 [quant-ph], 2015.
Eric Weisstein's World of Mathematics, Graph Diameter
Eric Weisstein's World of Mathematics, Knight Graph
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = ceiling(2n/3) for n > 4; see A004523. - R. J. Mathar, Nov 24 2013
From Colin Barker, Apr 26 2016: (Start)
a(n) = a(n-1)+a(n-3)-a(n-4) for n>8.
G.f.: -x^2*(1-6*x^2+5*x^5-2*x^6) / ((1-x)^2*(1+x+x^2)). (End)
EXAMPLE
For a classic 8 X 8 chessboard, a knight needs at most 6 moves to reach every square starting from a fixed position, so a(8) = 6.
For a 3 X 3 chessboard, it's impossible to reach the middle square starting from any other, so a(3) = -1.
MATHEMATICA
Replace[Table[GraphDiameter[KnightTourGraph[n, n]], {n, 20}], Infinity -> -1] (* Eric W. Weisstein, Nov 20 2019 *)
Join[{0, -1, -1, 5}, Table[Ceiling[2 n/3], {n, 5, 20}]] (* Eric W. Weisstein, Nov 20 2019 *)
Join[{0, -1, -1, 5}, LinearRecurrence[{1, 0, 1, -1}, {4, 4, 5, 6}, 20]] (* Eric W. Weisstein, Nov 20 2019 *)
CoefficientList[Series[-1 - x + 5 x^2 + x^3 (4 + x^2 - 3 x^3)/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Nov 20 2019 *)
PROG
(PARI) concat(0, Vec(-x^2*(1-6*x^2+5*x^5-2*x^6)/((1-x)^2*(1+x+x^2)) + O(x^100))) \\ Colin Barker, Apr 26 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Mateusz Szymański, Nov 16 2013
EXTENSIONS
More terms from Vaclav Kotesovec, Oct 21 2014
STATUS
approved