OFFSET
0,4
COMMENTS
In general a(n) = Sum{k=0..floor(n/2)} binomial(n-k, k-1) * r^(n-k-1) has g.f. x^2/((1-r*x^2)*(1-r*x-r*x^2)) and satisfies a(n) = r*a(n-1) + 2*r*a(n-2) - r^2*a(n-3) - r^2*a(n-4).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,8,-16,-16).
FORMULA
G.f.: x^2/((1-4*x^2)*(1-4*x-4*x^2)).
a(n) = 4*a(n-1) + 8*a(n-2) - 16*a(n-3) - 16*a(n-4) with a(n) = (n^3-n)/6 for n<5.
From G. C. Greubel, Jul 22 2022: (Start)
a(n) = 2^(n-4)*(2*A000129(n) - (1 - (-1)^n)).
a(n) = (1/4)*(A057087(n-1) - 2^(n-2)*(1 - (-1)^n)).
E.g.f.: (exp(2*x)*sinh(2*sqrt(2)*x) - sqrt(2)*sinh(2*x))/(8*sqrt(2)). (End)
MATHEMATICA
Table[Sum[Binomial[n-k, k-1]*4^(n-k-1), {k, 0, Floor[n/2]}], {n, 0, 30}] (* or *) LinearRecurrence[{4, 8, -16, -16}, {0, 0, 1, 4}, 30] (* Harvey P. Dale, Jul 19 2012 *)
PROG
(Magma) I:=[0, 0, 1, 4]; [n le 4 select I[n] else 4*(Self(n-1) +2*Self(n-2) -4*Self(n-3) -4*Self(n-4)): n in [1..41]]; // G. C. Greubel, Jul 22 2022
(SageMath) [2^(n-3)*(lucas_number1(n, 2, -1) - (n%2)) for n in (0..40)] # G. C. Greubel, Jul 22 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 23 2004
STATUS
approved