login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A232007 Maximal number of moves needed by a knight to reach every square from a fixed position on an n X n chessboard, or -1 if it is not possible to reach every square. 2
0, -1, -1, 5, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46 (list; graph; refs; listen; history; text; internal format)
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
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.
Eric Weisstein's World of Mathematics, Graph Diameter
Eric Weisstein's World of Mathematics, Knight Graph
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
Cf. A004523.
Sequence in context: A226578 A134206 A134209 * A019842 A357418 A303270
KEYWORD
sign,easy
AUTHOR
Mateusz Szymański, Nov 16 2013
EXTENSIONS
More terms from Vaclav Kotesovec, Oct 21 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 10:11 EDT 2024. Contains 371935 sequences. (Running on oeis4.)