OFFSET
0,5
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
C. N. Phadte and S. P. Pethe, On Second Order Non-homogeneous recurrence relation, Annales Mathematicae et informaticae, 41 (2013), pp. 205-210.
Index entries for linear recurrences with constant coefficients, signature (3,-1,-2).
FORMULA
G.f.: x*(1-3*x)/((1-2*x)*(1-x-x^2)).
a(n) = 3*a(n-1) -a(n-2) -2*a(n-3). [Bruno Berselli, Oct 03 2013]
MATHEMATICA
Table[LucasL[n + 1] - 2^n, {n, 0, 30}] (* Bruno Berselli, Oct 03 2013 *)
CoefficientList[Series[x (1 - 3 x)/((1 - 2 x) (1 - x - x^2)), {x, 0, 40}], x](* Vincenzo Librandi, Oct 05 2013 *)
PROG
(BASIC)
LET N=0
LET L=0
LET M=1
PRINT L
PRINT M
FOR I=1 TO 30
LET N=M+L-(2)^(I-1)
PRINT N
LET L=M
LET M=N
NEXT I
END
(Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!((1-3*x)/((1-2*x)*(1-x-x^2)))); // Bruno Berselli, Oct 03 2013
(PARI) a(n)=fibonacci(n)+fibonacci(n+2)-2^n \\ Charles R Greathouse IV, Oct 03 2013
(Magma) I:=[0, 1, 0, -1, -5]; [n le 5 select I[n] else Self(n-1)+Self(n-2)-2^(n-3): n in [1..35]]; // Vincenzo Librandi, Oct 05 2013
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Chandrakant N Phadte, Sep 18 2013
EXTENSIONS
More terms from Bruno Berselli, Oct 03 2013
STATUS
approved