OFFSET
2,2
COMMENTS
Extended to a(1) using the formula/recurrence.
LINKS
Eric Weisstein's World of Mathematics, Grid Graph
Eric Weisstein's World of Mathematics, Total Domination Number
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-2,1).
FORMULA
a(n) = ((-1)^n + 2*n*(n + 2) + 4*sin(n*Pi/2) - 1)/8.
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - 2*a(n-5) + a(n-6).
G.f.: (1 + 2*x^3 - x^4)/((1 - x)^3*(1 + x + x^2 + x^3)).
MATHEMATICA
Table[(-1 + (-1)^n + 2 n (2 + n) + 4 Sin[n Pi/2])/8, {n, 20}]
LinearRecurrence[{2, -1, 0, 1, -2, 1}, {1, 2, 3, 6, 9, 12}, 20]
CoefficientList[Series[(-1 - 2 x^3 + x^4)/((-1 + x)^3 (1 + x + x^2 + x^3)), {x, 0, 20}], x]
PROG
(PARI) for(n=1, 30, print1(round(((-1)^n + 2*n*(n + 2) + 4*sin(n*Pi/2) - 1)/8), ", ")) \\ G. C. Greubel, Apr 09 2018
(Magma) R:=RealField(); [Round(((-1)^n + 2*n*(n + 2) + 4*Sin(n*Pi(R)/2) - 1)/8): n in [1..30]]; // G. C. Greubel, Apr 09 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, Apr 08 2018
STATUS
approved