OFFSET
1,2
LINKS
Chess variants, Glinski's Hexagonal Chess
Wikipedia, Hexagonal chess - Gliński's hexagonal chess
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = n^2 - floor(n/2) - floor(n/2)^2.
From Stefano Spezia, Aug 18 2019 (Start)
G.f.: - (1 + x + 3*x^2 + x^3)/((- 1 + x)^3*(1 + x)^2).
E.g.f.: (1/8)*exp(-x)*(-1 + 2*x + exp(2*x)*(1 + 4*x + 6*x^2)).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 5.
a(n) = (1/16)*(3 + (-1)^(1+2*n) - 4*n + 12*n^2 - 2*(-1)^n*(1 + 2*n)).
a(2*n-1) = A003215(n).
a(2*n) = A049450(n).
(End)
EXAMPLE
a(1) = 1
.
o
.
a(2) = 2
.
. .
o . o
. .
.
a(3) = 7
.
o . o
. . . .
o . o . o
. . . .
o . o
.
a(4) = 10
.
. . . .
o . o . o
. . . . . .
o . o . o . o
. . . . . .
o . o . o
. . . .
.
MATHEMATICA
nn:=51; CoefficientList[Series[- (1 + x + 3*x^2 + x^3)/((- 1 + x)^3*(1 + x)^2), {x, 0, nn}], x] (* Georg Fischer, May 10 2020 *)
PROG
(PARI) a(n) = n^2 - (n\2) - (n\2)^2; \\ Andrew Howroyd, Aug 17 2019
(Python)
def A309805(n): return n**2-(m:=n>>1)*(m+1) # Chai Wah Wu, Apr 04 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sangeet Paul, Aug 17 2019
STATUS
approved