login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A227200
a(n) = a(n-1) + a(n-2) - 2^(n-1) with a(0)=a(2)=0, a(1)=-a(3)=1, a(4)=-5.
2
0, 1, 0, -1, -5, -14, -35, -81, -180, -389, -825, -1726, -3575, -7349, -15020, -30561, -61965, -125294, -252795, -509161, -1024100, -2057549, -4130225, -8284926, -16609455, -33282989, -66669660, -133507081, -267285605, -535010414, -1070731475
OFFSET
0,5
LINKS
C. N. Phadte and S. P. Pethe, On Second Order Non-homogeneous recurrence relation, Annales Mathematicae et informaticae, 41 (2013), pp. 205-210.
FORMULA
G.f.: x*(1-3*x)/((1-2*x)*(1-x-x^2)).
a(n) = -(-1)^n*A142585(n+1) = A000032(n+1) - 2^n. [Bruno Berselli, Oct 03 2013]
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
Cf. versions with different signs: A027974, A142585.
Sequence in context: A001215 A335651 A066767 * A027974 A027983 A142585
KEYWORD
sign,easy
AUTHOR
EXTENSIONS
More terms from Bruno Berselli, Oct 03 2013
STATUS
approved