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!)
A106542 a(n) = a(n-1) - 2*a(n-2) - 3*a(n-3) - ... - (n-1)*a(1), a(1) = a(2) = 3, a(3) = -3. 3

%I

%S 3,3,-3,-18,-33,-15,84,261,333,-138,-1557,-3315,-2436,6153,24009,

%T 36390,1431,-129639,-323292,-318819,400725,2149686,3807795,1476405,

%U -10310388,-30697599,-37588047,20103078,186854271,384871329,260548788,-769001739,-2840006499

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

%H Colin Barker, <a href="/A106542/b106542.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) = 3, a(3) = -3.

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

%F From _Colin Barker_, Dec 04 2015: (Start)

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

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

%t LinearRecurrence[{3,-5,2}, {3,3,-3}, 40] (* _G. C. Greubel_, Sep 03 2021 *)

%o (PARI) a=vector(40); a[1]=3; for(n=2, #a, a[n]=a[n-1]-sum(k=2, n-1, k*a[n-k])); a[1..#a] \\ _Colin Barker_, Dec 04 2015

%o (MAGMA) I:=[3,3,-3]; [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 A106542_list(prec):

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

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

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

%Y Cf. A106540, A106541.

%K easy,sign

%O 1,1

%A _Alexandre Wajnberg_, May 08 2005

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 August 17 23:13 EDT 2022. Contains 356204 sequences. (Running on oeis4.)