OFFSET
0,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-1,0,-2,-4).
FORMULA
G.f.: (1+2*x^3)/((1-x-2*x^2)*(1-x^2-2*x^4)).
a(n) = a(n-1) + 3*a(n-2) - a(n-3) - 2*a(n-5) - 4*a(n-6).
a(n) = Sum_{k=0..n} ( J(k+1) - J((k+1)/2)*(1-(-1)^k)/2 ).
a(n) = Sum_{j=0..floor(n/2)} A001045(n-j+1). - G. C. Greubel, Jan 31 2024
MATHEMATICA
LinearRecurrence[{1, 3, -1, 0, -2, -4}, {1, 1, 4, 8, 19, 37}, 30] (* Harvey P. Dale, Oct 22 2011 *)
PROG
(Magma)
A001045:= func< n | (2^n - (-1)^n)/3 >;
[(&+[A001045(n-j+1): j in [0..Floor(n/2)]]): n in [0..30]]; // G. C. Greubel, Jan 31 2024
(SageMath)
def A001045(n): return (2^n - (-1)^n)/3
[A129362(n) for n in range(31)] # G. C. Greubel, Jan 31 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Apr 11 2007
STATUS
approved