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”).

A140167
a(n) = (-1)*a(n-1) + 3*a(n-2) with a(1)=-1 and a(2)=1.
7
-1, 1, -4, 7, -19, 40, -97, 217, -508, 1159, -2683, 6160, -14209, 32689, -75316, 173383, -399331, 919480, -2117473, 4875913, -11228332, 25856071, -59541067, 137109280, -315732481, 727060321, -1674257764, 3855438727, -8878212019, 20444528200
OFFSET
1,3
COMMENTS
A140165 is a companion sequence.
FORMULA
a(n) = (-1)*a(n-1) + 3*a(n-2), given a(1) = -1, a(2) = 1. a(n) = term (1,2) of X^n, where X = the 2x2 matrix [1,-1; -1,-2].
From R. J. Mathar, Dec 12 2009: (Start)
a(n) = (-1)^n*A006130(n-1).
G.f.: -x/(1+x-3*x^2). (End)
G.f.: -Q(0)/2 , where Q(k) = 1 + 1/(1 - x*(4*k-1 + 3*x)/( x*(4*k+1 + 3*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 08 2013
E.g.f.: (1/sqrt(13))*(exp(-(1+sqrt(13))*x/2) - exp(-(1-sqrt(13))*x/2)). G. C. Greubel, Aug 30 2015
a(n) = -(-sqrt(3))^(n-1)*(Lucas(n-1, 1/sqrt(3)) + Fibonacci(n-1, 1/sqrt(3) )/sqrt(3))/2. - G. C. Greubel, Dec 26 2019
EXAMPLE
a(5) = -19 = (-1)*7 + 3*(-4).
a(5) = -19 = term (1,2) of X^5 since X^5 = [ -2, -19; -19, -59].
MAPLE
seq(coeff(series(-x/(1+x-3*x^2), x, n+1), x, n), n = 1..30); # G. C. Greubel, Dec 26 2019
MATHEMATICA
RecurrenceTable[{a[n]== -a[n-1]+3*a[n-2], a[1]== -1, a[2]==1}, a, {n, 30}] (* G. C. Greubel, Aug 30 2015 *)
Table[Round[-(-Sqrt[3])^(n-1)*(LucasL[n-1, 1/Sqrt[3]] + Fibonacci[n-1, 1/Sqrt[3] ]/Sqrt[3])/2], {n, 30}] (* G. C. Greubel, Dec 26 2019 *)
PROG
(PARI) first(m)=my(v=vector(m)); v[1]=-1; v[2]=1; for(i=3, m, v[i]=-v[i-1] + 3*v[i-2]); v \\ Anders Hellström, Aug 30 2015
(Magma) I:=[-1, 1]; [n le 2 select I[n] else (-1)*Self(n-1) + 3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Aug 31 2015
(Sage)
def A140167_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( -x/(1+x-3*x^2) ).list()
a=A140167_list(30); a[1:] # G. C. Greubel, Dec 26 2019
(GAP) a:=[-1, 1];; for n in [3..30] do a[n]:= -a[n-1]+3*a[n-2]; od; a; # G. C. Greubel, Dec 26 2019
CROSSREFS
Sequence in context: A062306 A323105 A006130 * A182228 A352007 A182646
KEYWORD
sign,easy
AUTHOR
Gary W. Adamson, May 10 2008
STATUS
approved