login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A106541 a(n) = a(n-1) - 2*a(n-2) - 3*a(n-3) - ... - (n-1)*a(1), with a(1) = a(2) = 2, a(3) = -2. 3

%I #26 Sep 08 2022 08:45:18

%S 2,2,-2,-12,-22,-10,56,174,222,-92,-1038,-2210,-1624,4102,16006,24260,

%T 954,-86426,-215528,-212546,267150,1433124,2538530,984270,-6873592,

%U -20465066,-25058698,13402052,124569514,256580886,173699192,-512667826,-1893337666

%N a(n) = a(n-1) - 2*a(n-2) - 3*a(n-3) - ... - (n-1)*a(1), with a(1) = a(2) = 2, a(3) = -2.

%H G. C. Greubel, <a href="/A106541/b106541.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-5,2).

%F a(n) = a(n-1) - Sum_{k=2..n-1} k*a(n-k), with a(1) = a(2) = 2, a(3) = -2.

%F a(n) = 2*A106540(n).

%F From _Colin Barker_, Aug 25 2016: (Start)

%F a(n) = 3*a(n-1) - 5*a(n-2) + 2*a(n-3) for n>3.

%F G.f.: 2*x*(1-x)^2/(1-3*x+5*x^2-2*x^3). (End)

%t lst={2,2,-2};f[n_]:=With[{c=(Times@@@Thread[{lst,Range[Length[lst],1, -1]}])}, Last[c]- Total[Most[c]]]; Do[AppendTo[lst,f[lst]],{40}];lst (* _Harvey P. Dale_, Apr 17 2012 *)

%o (Magma) I:=[2,2,-2]; [n le 3 select I[n] else 3*Self(n-1) - 5*Self(n-2) + 2*Self(n-3): n in [1..41]]; // _G. C. Greubel_, Sep 03 2021

%o (Sage)

%o def A106541_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return P( 2*x*(1-x)^2/(1-3*x+5*x^2-2*x^3) ).list()

%o a=A106541_list(41); a[1:] # _G. C. Greubel_, Sep 03 2021

%Y Cf. A106540, A106542.

%K easy,sign

%O 1,1

%A _Alexandre Wajnberg_, May 08 2005

%E More terms from _Harvey P. Dale_, Apr 17 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:24 EDT 2024. Contains 371967 sequences. (Running on oeis4.)