cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A140165 a(n) = -a(n-1) + 3*a(n-2), starting a(1)=1, a(2)=2.

This page as a plain text file.
%I A140165 #39 Jun 11 2024 14:45:04
%S A140165 1,2,1,5,-2,17,-23,74,-143,365,-794,1889,-4271,9938,-22751,52565,
%T A140165 -120818,278513,-640967,1476506,-3399407,7828925,-18027146,41513921,
%U A140165 -95595359,220137122,-506923199,1167334565
%N A140165 a(n) = -a(n-1) + 3*a(n-2), starting a(1)=1, a(2)=2.
%C A140165 Row sums of triangle A140166.
%C A140165 Equals eigensequence of triangle A112555. - _Gary W. Adamson_, Jan 30 2009
%H A140165 G. C. Greubel, <a href="/A140165/b140165.txt">Table of n, a(n) for n = 1..1000</a>
%H A140165 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-1,3).
%F A140165 a(n) = term (1,1) of X^n, where X = the 2 X 2 matrix [1,-1; -1,-2].
%F A140165 G.f.: x*(1+3*x)/(1+x-3*x^2). - _Philippe Deléham_, Dec 18 2011
%F A140165 a(n) = -(3*A140167(n-1) + A140167(n)). - _R. J. Mathar_, Apr 22 2013
%F A140165 a(n) = (-sqrt(3))^n*( Lucas(n, 1/sqrt(3)) - 5*Fibonacci(n, 1/sqrt(3))/sqrt(3) )/2. - _G. C. Greubel_, Dec 26 2019
%F A140165 E.g.f.: (1/13)*exp(-x/2)*(13*cosh(sqrt(13)*x/2) + 5*sqrt(13)*sinh(sqrt(13)*x/2)) - 1. - _Stefano Spezia_, Jan 02 2020
%e A140165 a(6) = 17 = (-1)*a(5) + 3*a(4) = (-1)*(-2) + 3*5.
%e A140165 a(4) = 5 = term (1,1) of X^5, where X^5 = [5,7; 7,26].
%p A140165 seq(coeff(series(x*(1+3*x)/(1+x-3*x^2), x, n+1), x, n), n = 1..30); # _G. C. Greubel_, Dec 26 2019
%t A140165 Table[Round[(-Sqrt[3])^n*(LucasL[n, 1/Sqrt[3]] - 5*Fibonacci[n, 1/Sqrt[3]]/Sqrt[3])/2], {n,0,30}] (* _G. C. Greubel_, Dec 26 2019 *)
%t A140165 LinearRecurrence[{-1,3},{1,2},40] (* _Harvey P. Dale_, Jun 11 2024 *)
%o A140165 (PARI) my(x='x+O('x^30)); Vec(x*(1+3*x)/(1+x-3*x^2)) \\ _G. C. Greubel_, Dec 26 2019
%o A140165 (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( x*(1+3*x)/(1+x-3*x^2) )); // _G. C. Greubel_, Dec 26 2019
%o A140165 (Magma) a:=[1,2]; [n le 2 select a[n] else -Self(n-1) + 3*Self(n-2): n in [1..30]]; // _Marius A. Burtea_, Jan 02 2020
%o A140165 (Sage)
%o A140165 def A140165_list(prec):
%o A140165     P.<x> = PowerSeriesRing(ZZ, prec)
%o A140165     return P( x*(1+3*x)/(1+x-3*x^2) ).list()
%o A140165 a=A140165_list(30); a[1:] # _G. C. Greubel_, Dec 26 2019
%o A140165 (GAP) a:=[1,2];; for n in [3..30] do a[n]:=-a[n-1]+3*a[n-2]; od; a; # _G. C. Greubel_, Dec 26 2019
%Y A140165 Cf. A140166, A140167, A112555.
%K A140165 sign,easy
%O A140165 1,2
%A A140165 _Gary W. Adamson_, May 10 2008