OFFSET
1,1
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Ladder Graph
Eric Weisstein's World of Mathematics, Minimum Dominating Set
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(n) = 2*(n+2) for mod(n, 2)=0 and n != 2,6.
a(n) = 2 for mod(n, 2)=1 and n != 3.
a(n) = 2*a(n-2)-a(n-4) for n > 6.
G.f.: x*(2 + 6*x - x^2 - 2*x^4 - x^5 + x^6 - 2*x^7 + x^9)/((-1 + x)^2*(1 + x)^2).
MATHEMATICA
Join[{2, 6, 3, 12, 2, 17}, LinearRecurrence[{0, 2, 0, -1}, {2, 20, 2, 24}, 20]]
CoefficientList[Series[(2 + 6 x - x^2 - 2 x^4 - x^5 + x^6 - 2 x^7 + x^9)/((-1 + x)^2 (1 + x)^2), {x, 0, 20}], x]
PROG
(PARI) a(n)={if(n%2, 1, n+2)*2 + if(n<=6, [0, -2, 1, 0, 0, 1][n])} \\ Andrew Howroyd, Jan 18 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Sep 06 2021
STATUS
approved