OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-2,-1,-1,-3,2,1,1,1).
FORMULA
G.f.: x*(3-2*x^2+4*x^3-x^4-3*x^5-2*x^7)/((1-x-x^2)*(1-x^2-x^4)^2). - Maksym Voznyy (voznyy(AT)mail.ru), Jul 27 2009
From G. C. Greubel, Jan 17 2022: (Start)
a(2*n) = Lucas(2*n+3) + F(2*n+2) - Lucas(n+3) - (n+1)*F(n+2).
a(2*n+1) = Lucas(2*n+4) + F(2*n+3) - Lucas(n+3) - (n+2)*F(n+2), where F(n) = A000045(n). (End)
MATHEMATICA
a[n_]:= With[{F=Fibonacci}, If[EvenQ[n], LucasL[n+3] + F[n+2] - LucasL[n/2 +3] - (n/2 +1)*F[n/2 +2], LucasL[n+3] + F[n+2] - LucasL[(n+5)/2]-(n+3)/2*Fibonacci[(n+3)/2]]];
Table[a[n], {n, 40}] (* G. C. Greubel, Jan 17 2022 *)
PROG
(Magma)
R<x>:=PowerSeriesRing(Integers(), 40);
Coefficients(R!( x*(3-2*x^2+4*x^3-x^4-3*x^5-2*x^7)/((1-x-x^2)*(1-x^2-x^4)^2) )); // G. C. Greubel, Jan 17 2022
(Sage)
def A024313_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x*(3 -2*x^2 +4*x^3 -x^4 -3*x^5 -2*x^7)/((1-x-x^2)*(1-x^2-x^4)^2) ).list()
a=A024313_list(41); a[1:] # G. C. Greubel, Jan 17 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved