OFFSET
0,1
COMMENTS
For n>1, a(n) is the number of row vectors of length 2n with entries in [1,n], first entry 1, with maximum inner distance. That is, vectors where the modular distance between adjacent entries is at least (n-2)/2. Modular distance is the minimum of remainders of (x - y) and (y - x) when dividing by n. Geometrically, this metric counts how far the integers mod n are from each other if 1 and n are adjacent as on a circle. - Omar Aceval Garcia, Jan 30 2021
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Omar Aceval Garcia, On the Number of Maximum Inner Distance Latin Squares, arXiv:2112.13912 [math.CO], 2021.
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Colin Barker, Oct 15 2014
G.f.: 2*(1-x+x^2+x^3) / ((1-x)^3*(x+1)). - Colin Barker, Oct 15 2014
E.g.f.: cosh(x) + (1 + x + x^2)*exp(x). - G. C. Greubel, Dec 14 2021
MATHEMATICA
Table[n^2 + 3/2 + (-1)^n/2, {n, 0, 50}] (* Bruno Berselli, Oct 15 2014 *)
CoefficientList[Series[2(x^3+x^2-x+1)/((1-x)^3 (x+1)), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 15 2014 *)
LinearRecurrence[{2, 0, -2, 1}, {2, 2, 6, 10}, 60] (* Harvey P. Dale, Apr 08 2019 *)
PROG
(PARI) Vec(-2*(x^3+x^2-x+1)/((x-1)^3*(x+1)) + O(x^100)) \\ Colin Barker, Oct 15 2014
(Magma) [n^2+3/2+(-1)^n/2: n in [0..50]]; // Vincenzo Librandi, Oct 15 2014
(Sage) [(2*n^2 +3 +(-1)^n)/2 for n in (0..50)] # G. C. Greubel, Dec 14 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 14 2014
EXTENSIONS
Typo in data fixed by Colin Barker, Oct 15 2014
STATUS
approved