OFFSET
1,4
LINKS
Eric Weisstein's World of Mathematics, Graph Cycle
Eric Weisstein's World of Mathematics, Knight Graph
Index entries for linear recurrences with constant coefficients, signature (3, -3, 1).
FORMULA
For n > 5, a(n) = 4 (34 n^2 - 259 n + 484).
G.f.: (4*x^4*(-5 - 26*x - 46*x^2 + 7*x^3 + 2*x^4))/(-1 + x)^3.
MATHEMATICA
Table[Length[FindCycle[KnightTourGraph[n, n], {6}, All]], {n, 20}]
Table[Piecewise[{{0, n < 4}, {20, n == 4}, {164, n == 5}}, 4 (34 n^2 - 259 n + 484)], {n, 20}]
Join[{0, 0, 0, 20, 164}, LinearRecurrence[{3, -3, 1}, {1036, 408, 52}, {6, 20}]]
CoefficientList[Series[(4 x^3 (-5 - 26 x - 46 x^2 + 7 x^3 + 2 x^4))/(-1 + x)^3, {x, 0, 20}], x]
PROG
(PARI) a(n)=4*if(n>5, 34*n^2 - 259*n + 484, max(36*n-139, 0)) \\ Charles R Greathouse IV, Oct 21 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Jun 27 2017
STATUS
approved