OFFSET
-1,2
COMMENTS
a(n-2) = 2^(2n-1) - (n+1)*2^(n-2) is number of compositions of 2n where each part <= n: e.g., for n=2, 4 can be written 5 ways with no part greater than 2 as 1+1+1+1 = 1+1+2 = 1+2+1 = 2+1+1 = 2+2. - Henry Bottomley, Feb 03 2003
LINKS
Delbert L. Johnson, Table of n, a(n) for n = -1..1659
Index entries for linear recurrences with constant coefficients, signature (8,-20,16).
FORMULA
G.f.: 8/(1-4*x) - 3/(1-2*x) - 2*x/(1-2*x)^2 + 1/x. - R. J. Mathar, Nov 21 2007
a(n) = 8*a(n-1) - 20*a(n-2) + 16*a(n-3). - Wesley Ivan Hurt, Sep 04 2022
MATHEMATICA
Table[Coefficient[Series[(1 - x)/(1 - 2 x + x^(n + 1)), {x, 0, 2 n}], x^(2 n)], {n, 1, 22}] (* Geoffrey Critzer, May 29 2013 *)
LinearRecurrence[{8, -20, 16}, {1, 5, 24}, 30] (* Harvey P. Dale, May 15 2022 *)
PROG
(PARI) a(n)=2^(2*n+3)-2^n*(n+3) \\ Charles R Greathouse IV, Oct 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved