OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,3,-8,4).
FORMULA
a(n) = 2^n/4 - (-2)^n/36 + 2*n/3 - 2/9.
G.f.: z*(1 - 3*z^2)/((1 - 4*z^2)*(1 - z)^2).
E.g.f.: (cosh(x)*(5*sinh(x) + 6*x - 2) + 2*(cosh(2*x) + (3*x - 1)*sinh(x)))/9. - Stefano Spezia, Jun 12 2023
EXAMPLE
a(3) = 4 because the permutations 123, 231, 312, 321 of {1,2,3} contain 4 fixed points altogether (all three entries of the first permutation and entry 2 in the last one).
MAPLE
seq(2^n/4-(-2)^n/36+2*n/3-2/9, n=0..40);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Mar 22 2002
STATUS
approved