OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,7,-12,-11,16,-4).
FORMULA
From G. C. Greubel, Oct 26 2022: (Start)
a(n) = (1/2)*( (-1)^n*LucasL(n) + LucasL(2*n) - (1 + (-1)^n)*2^(n-1) - [n=0]).
a(n) = 2*a(n-1) + 7*a(n-2) - 12*a(n-3) - 11*a(n-4) + 16*a(n-5) - 4*a(n-6), n >= 7.
G.f.: (1 - x - 6*x^2 + 6*x^3 + 7*x^4 - 2*x^6)/((1 - 4*x^2)*(1 + x - x^2)*(1 - 3*x + x^2)). (End)
MATHEMATICA
LinearRecurrence[{2, 7, -12, -11, 16, -4}, {1, 1, 3, 7, 19, 56, 138}, 51] (* G. C. Greubel, Oct 26 2022 *)
PROG
(Magma) [n eq 0 select 1 else ((-1)^n*Lucas(n) +Lucas(2*n) -(1+(-1)^n)*2^(n-1))/2: n in [0..50]]; // G. C. Greubel, Oct 26 2022
(SageMath)
def A147586(n): return ((-1)^n*lucas_number2(n, 1, -1) + lucas_number2(2*n, 1, -1) - (1 + (-1)^n)*2^(n-1) -int(n==0))/2
[A147586(n) for n in range(51)] # G. C. Greubel, Oct 26 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Nov 08 2008
EXTENSIONS
Terms a(11) onward added by G. C. Greubel, Oct 26 2022
STATUS
approved